Generation and querying of project tables
project.RmdA project stores soil-property summaries, seismic displacement
realizations and their summaries, and yield coefficients associated with
admissible displacements. In ShearTable, the fundamental
period of the truncated shear-beam model is evaluated from summarized
soil properties; a row labelled by a quantile is not a quantile of the
period population. DnDraws retains displacements by demand,
geometry, material, model, realization and yield coefficient, whereas
DnTable contains means and quantiles.
kmaxTable summarizes the yield coefficients obtained by
inverting those displacement realizations at the admissible displacement
levels.
The project contract is a JSON object that identifies input and table
paths and supplies the parameters required by the selected steps.
Relative paths, including the contract’s own path, are resolved against
the project root. The contract directory does not provide a second path
origin. Unknown keys are rejected, and the required keys depend on the
steps selected. The contract distinguishes geometries and materials, the
hazard model and return periods, the number of realizations,
displacement-model switches and admissible displacements expressed as
percentages of height. The ShearTable step takes an
optional seed, without which the contract alone does not make its table
reproducible; the displacement step uses fixed seeds for its site and
demand combinations.
processProject(), exposed as
newmark process, executes selected steps in the order
ShearTable, DnTable, kmaxTable.
The displacement step reads the shear table, the hazard product
MCETable.Rds and each selected site’s
UHSRock.Rds. It publishes DnDraws,
PGATable and DnTable for that site. The
coefficient step reads the stored displacement realizations and
peak-acceleration table together with the shear table, then publishes
the site’s kmaxTable. Inputs that no selected step produces
must already exist when the run is planned. The hazard inputs are read
from their declared locations; project processing writes its tables
under path.tables.
Site tables reside under <ID.gmdp>/<siteID>/
within that table directory, while global tables reside at its root.
Site selection determines which site calculations run. It does not
restrict the global tables to those newly calculated sites: the global
displacement and coefficient tables are rebuilt from available
corresponding tables of the sites discovered under
path.uhs, including unselected sites. A discovered site
without the corresponding table is omitted from that assembly. A site
coefficient table without its associated peak-acceleration table stops
coefficient assembly. Consequently, a global result can combine tables
from the current run with previously stored site tables.
With dryRun = TRUE, processing reports the selected
steps, sites and destinations without calculating, seeding or writing.
When ShearTable is not selected, checks for
DnTable inspect the existing shear table and required
seismic demand, and checks for kmaxTable inspect the
shear-table heights. When ShearTable is selected, the dry
run cannot examine the table that the step would produce; the actual run
performs those downstream checks after publishing it. A successful dry
run therefore does not establish that subsequent calculations and
publication will succeed.
Publication replaces files individually. Each file replacement is
atomic, but a group of tables and the complete run are not atomic and
have no rollback. A later failure leaves earlier published files in
place. The returned effects record identifies each published file by
step, site, product, path, action and row count. After partial
publication, the R error has class
newmarkPartialPublication and carries that record; the
command writes the record to standard output and the failure to standard
error, with exit status 1.
listProjectTables(), exposed as
newmark listProjectTables, reports existing table files
with their row counts, column names, keys, file sizes and modification
times. queryProjectTable(), exposed as
newmark query, reads one global or site table and selects
rows and columns without changing the stored table. A row passes a
column filter when it matches any of that filter’s values, and passes
the query when it satisfies every column filter. Numeric filters match
stored numbers exactly, while text filters preserve stored labels. The
returned rows retain their stored order and types, and the requested
column order determines the returned columns. For DnTable
and kmaxTable, the query adds the column
extrapolated, which is not stored: it is 1 when the
ky of a row, or its kmax other than 0, lies
outside the calibration range that buildKyLimits() gives
its model at the mean site peak ground acceleration of the demand,
geometry and material, or, for an ensemble,
rigid or flexible row, outside the range of
any of its models stored for the same site, demand, geometry and
material, and 0 otherwise.