Configuration Files¶
gFlex can be driven by a YAML configuration file rather than (or alongside)
the programmatic Python API. Pass the file path to the gflex CLI or
to an F1D / F2D constructor. The file
must have a .yaml or .yml extension.
Parameters¶
mode section¶
dimension1or2. Selects a 1-D (profile) or 2-D (map-view) flexural solution.methodSolution method:
fd— Finite Difference. Supports spatially variable elastic thickness. Requires a grid (dx, anddyin 2-D).fft— Spectral (Fast Fourier Transform). Requires scalar (uniform) \(T_e\). Spectrally accurate and fast. When all boundary conditions areperiodicthe domain tiles exactly; for any other boundary condition the load is zero-padded by \(4\alpha\) on each side, approximating theno_outside_loadscondition. In-plane stresses (\(\sigma_{xx}\), \(\sigma_{yy}\), \(\sigma_{xy}\)) are supported.sas— Superposition of Analytical Solutions. Constant elastic thickness only; fast and analytically exact.sas_ng— SAS on an unstructured point set (NG = “no grid”). Load and output locations are arbitrary (x, q0) or (x, y, q0) columns; seeloadsbelow.
parameter section¶
youngs_modulusYoung’s modulus \(E\) [Pa]. Typical lithospheric value: 65 GPa (
6.5e10).poissons_ratioPoisson’s ratio \(\nu\) [dimensionless]. Typical value: 0.25.
gravitational_accelerationGravitational acceleration \(g\) [m s⁻²]. Earth standard: 9.8.
mantle_densityDensity of the mantle \(\rho_m\) [kg m⁻³]. Typical value: 3300.
infill_material_densityDensity of the material that fills (or vacates) the flexural depression \(\rho_\text{fill}\) [kg m⁻³]. Common values:
0— air (no infill)1030— seawater2000–2700— sediment
If the infill density varies spatially (e.g., at a subsiding shoreline that progressively floods), iterate externally: flex, update the inundation mask, re-flex, repeat.
input section¶
loadsPath to the load file.
Gridded methods (FD, SAS): a space-delimited array of surface normal stresses [Pa] (\(\rho g h\)). Grid cell area (\(\Delta x \times \Delta y\)) is applied internally to convert stress to force.
SAS_NG: a space-delimited file with columns
(x, q0)in 1-D or(x, y, q0)in 2-D, where q0 is a point force [N].
Paths are resolved relative to the directory containing the configuration file.
elastic_thicknessElastic thickness [m]. Either a scalar value or a path to a space-delimited array. Arrays are required for FD solutions with spatially variable Te. Use
smooth_pad_Te()andpad_domain()(2-D) orsmooth_pad_Te_1d()andpad_domain_1d()(1-D) to extend a variable-Te grid with a smooth boundary buffer before running.xw,yw(SAS_NG only) Vectors of x (and y for 2-D) coordinates at which to evaluate deflection. If omitted, deflection is evaluated at the load points.
output section¶
deflection_outPath for writing deflection output as a space-delimited ASCII file. Leave blank to suppress file output.
plotControls inline plotting after the run:
q— plot the applied load.w— plot the deflection.both— deflection and load in separate subplots.combo— (1-D only) deflection with the load overlaid.
Any other value (or blank) suppresses plotting.
numerical section¶
grid_spacing_xGrid cell size in the x-direction [m].
boundary_condition_west,boundary_condition_eastBoundary conditions on the west and east edges.
For FD:
zero_displacement_zero_slope(aliasclamped),zero_displacement_zero_moment,zero_moment_zero_shear(aliasfree),zero_slope_zero_shear(aliasmirror), orperiodic. See Boundary Conditions for the physical meaning of each and guidance on choosing.For SAS / SAS_NG:
no_outside_loads(assumed if left blank).
Note
In-plane stresses (\(\sigma_{xx}\), \(\sigma_{yy}\),
\(\sigma_{xy}\) [Pa]) cannot be set from a configuration file.
They must be assigned programmatically before calling
initialize():
flex.sigma_xx = 1e6 # east–west compression [Pa]
flex.sigma_yy = 0.
flex.sigma_xy = 0.
All three default to zero if not set. They are supported by fd
and fft in 2-D, and by fd and fft in 1-D (sigma_xx
only). Setting them with sas or sas_ng raises a warning and
has no effect. See Theory for the governing equations.
numerical2D section¶
grid_spacing_yGrid cell size in the y-direction [m].
boundary_condition_north,boundary_condition_southSame options as
boundary_condition_west/boundary_condition_east.latlontrue/false. Interpret input coordinates as geographic latitude and longitude. Default:false.planetary_radiusPlanetary radius [m]. Required when
latlon = true. Earth: 6 371 000 m.
verbosity section¶
verbosetrue/false. Print progress messages during the run. Default:true.debugtrue/false. Print internal arrays and solver diagnostics. Default:false.quiettrue/false. Suppress all output. Overridesverboseanddebug. Default:false.
Complete examples¶
1-D finite-difference example (YAML)¶
# All units are SI.
mode:
dimension: 1
method: fd
parameter:
youngs_modulus: 6.5e10
poissons_ratio: 0.25
gravitational_acceleration: 9.8
mantle_density: 3300
infill_material_density: 0
input:
loads: q0_sample/1D/central_block.txt
elastic_thickness: Te_sample/1D/8km_20km_ramp.txt
output:
deflection_out: ""
plot: combo # overlay deflection and load (1-D only)
numerical:
grid_spacing_x: 6000
boundary_condition_west: periodic
boundary_condition_east: periodic
verbosity:
verbose: false
debug: false
quiet: false
2-D finite-difference example (YAML)¶
# All units are SI.
mode:
dimension: 2
method: fd
parameter:
youngs_modulus: 6.5e10
poissons_ratio: 0.25
gravitational_acceleration: 9.8
mantle_density: 3300
infill_material_density: 0
input:
loads: q0_sample/2D/diag.txt
elastic_thickness: Te_sample/2D/fault_24-30.txt
output:
deflection_out: ""
plot: both
numerical:
grid_spacing_x: 4000
boundary_condition_west: zero_moment_zero_shear
boundary_condition_east: zero_displacement_zero_slope
numerical2D:
grid_spacing_y: 4000
boundary_condition_north: mirror
boundary_condition_south: zero_slope_zero_shear
verbosity:
verbose: false
debug: false
quiet: false