Skip to content

Commit

Permalink
Instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
awickert committed Jan 21, 2015
1 parent 8aacf72 commit 99cd29b
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,51 @@ gFlex
=====

Multiple methods to solve elastic beam and plate flexure, designed for applications to Earth's lithosphere.

To run gflex, first install the program at the command prompt using setuptools.

```
sudo python setup.py install
```

Then you can generate a configuration file (see examples in the **gflex/input** directory) and input data and run gFlex. It can produce plots and ASCII files with model outputs.

```
# run like this:
gflex <path-to-configuration-file>
```

To run gFlex inside of GRASS GIS, you may copy **r.flexure** to the **scripts** directory of your GRASS GIS installation. This isn't the real way to install GRASS GIS add-ons, but it works for the moment until gFlex is complete enough to be submitted to the GRASS GIS add-ons repository.

To run gFlex within the CSDMS environment, see **gflex_bmi.py**.

To run gFlex from other Python programs, simply add code like you will find in **gflex_copy_paste.py**:

```
import gflex
# If you want to use an input file:
filename = '../gflex/input/input_f1d_test' # it works for usage (1) and (2)
obj = gflex.WhichModel(filename)
## SET MODEL TYPE AND DIMENSIONS HERE ##
########################################
if obj.dimension == 1:
obj = gflex.F1D(filename)
elif obj.dimension == 2:
obj = gflex.F2D(filename)
# Othrwise just initialize with getters and setters
# e.g.,
# obj.set_value('GridSpacing_y', 50000)
# Then run the code!
obj.initialize(filename)
# You can use getters/setters here too
obj.run()
obj.finalize()
# Standalone plotting output if you so desire
obj.output()
```

0 comments on commit 99cd29b

Please sign in to comment.