[CIG-SHORT] Running PyLith reading parameters from a .CSV file

Charles Williams willic3 at gmail.com
Wed Oct 7 12:02:57 PDT 2015


To follow on from Brad’s comment, you can also provide parameters on the command line.  It depends on how many parameters you want to vary, of course.  If it is only a few, it would be pretty easy to provide these from the command line.  At present, PyLith is set up to get parameters from a .cfg file, the command line, or an XML file.

Cheers,
Charles


> On 8/10/2015, at 7:59 am, Brad Aagaard <baagaard at usgs.gov> wrote:
> 
> David,
> 
> In general, it is easiest to just separate groups of parameters into different .cfg files. As in examples/3d/hex8, we use a main pylithapp.cfg file for parameters common to all of the simulations, and the use stepXX.cfg for each step. You can separate your parameters into however many .cfg files make sense. In running PyLith, you just list them on the command line, e.g., pylith paramsA.cfg paramsB.cfg paramsC.cfg. You do not need to list pylithapp.cfg, because it is read by default.
> 
> Regards,
> Brad
> 
> 
> On 10/7/15 11:13 AM, David Castineira wrote:
>> Dear CIG representative,
>> 
>> My name is David Castineira and I’m a Research Scientist at the MIT. I
>> have a couple of questions about running PyLith so I was wondering if
>> you could help me out (note: I’m new into PyLith so I apologize if this
>> is trivial; I could not find a quick answer on the manual though):
>> 
>> Let’s say I want to run a specific PyLith simulation using a text file
>> in .cfg format. Let’s imagine that I want to test multiple variations of
>> that simulation by changing specific parameters (e.g., different values
>> for the static coefficient of friction and different values for the
>> total simulation time). Ideally I would like to be able to define those
>> parameters in a separate file (preferably a .CSV file) and then read or
>> load that file when running the main .cfg file. Is it possible to do
>> that within PyLith? I mean, how can I tell Pylith that the value of the
>> first cell in my .CSV file (for example) is the total simulation time,
>> i.e.,
>> 
>> [pylithapp.problem.formulation.time_step]
>> 
>> total_time = *30**day
>> 
>> Of course I can do the trick playing with with text editors outside
>> PyLith, but if I could formally do this within PyLith that would be better.
>> 
>> Best and thanks in advance,
>> 
>> David
>> 
>> David Castiñeira
>> 
>>   Research Scientist, Dpt of Civil and Environmental Engineering
>> 
>> *MIT*(Massachusetts Institute of Technology)
>> 
>>   Email: davidcas at mit.edu <mailto:davidcas at mit.edu>; Phone: (+1)
>> 512-417-2569
>> 
>> 
>> 
>> _______________________________________________
>> CIG-SHORT mailing list
>> CIG-SHORT at geodynamics.org
>> http://lists.geodynamics.org/cgi-bin/mailman/listinfo/cig-short
>> 
> 
> _______________________________________________
> CIG-SHORT mailing list
> CIG-SHORT at geodynamics.org
> http://lists.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



More information about the CIG-SHORT mailing list