Project

EarthSciIntegrator

One specification for integrating EarthSciML models — explicit, implicit and IMEX methods, operator splitting, a planner, and discrete adjoints — implemented natively in Julia and Rust and checked against each other.

Contents

observed_program

Stable type · Other

Tier: stable · Kind: type · Topic: Other

JuliaRust
ObservedDocumentearthsci_integrator_planner::numeric::Program

Julia

struct ObservedDocument
ObservedDocument(built::EarthSciIntegrator.BuiltDocument, names::Vector{String})
ObservedDocument(built, names)
ObservedDocument(doc::AbstractDict, L::EarthSciIntegrator.DofLayout, time)
ObservedDocument(doc, L, time)

The document doc (a JSON object) built (build_document) from observed_document (doc) for the DOF layout L, so that observed_values reads every observed of its flattened model without making the observed a state; L is empty for a document with no states (an algebraic assembly). Its right-hand side over L is the document’s own. names[k] is the k-th observed’s flattened name, in code-point order. The Rust planner’s numeric::Program::with_observed.

Source

Rust

pub struct Program {
    /* private fields */
}

impl Program { pub fn new<'a>(input: impl Into<ProblemInput<'a>>, tspan: (f64, f64), dofs: &Dofs) -> Result<Program, String> }

impl Program { pub fn with_initial_state(info: &ModelInfo, doc: &Value, tspan: (f64, f64), dofs: &Dofs) -> Result<(Program, Vec<f64>), String> }

impl Program { pub fn from_program(prog: RhsProgram, dofs: &Dofs) -> Result<Program, String> }

impl Program { pub fn with_observed(doc: &Value, tspan: (f64, f64), dofs: &Dofs) -> Result<Program, String> }

impl Program { pub fn observed_names(&self) -> impl Iterator<Item = &str> }

impl Program { pub fn observed(&self, u: &[f64], p: &[f64], t: f64, forcing: Option<&Forcing>) -> Result<BTreeMap<String, Vec<f64>>, String> }

impl Program { pub fn program(&self) -> &RhsProgram }

impl Program { pub fn default_parameters(&self) -> &[f64] }

impl Program { pub fn block_range(&self, name: &str) -> Option<(usize, usize)> }

impl Program { pub fn forcing_slot_names(&self) -> Vec<&str> }

impl Program { pub fn forcing_set(&self, f: &Forcing) -> Result<ForcingSet, String> }

impl Program { pub fn eval_with<R>(&self, u: impl Fn(usize) -> f64, p: impl Fn(usize) -> f64, t: f64, forcing: &Forcing, g: impl FnOnce(&[f64]) -> R) -> Result<R, String> }

impl Program { pub fn eval_with_set<R>(&self, u: impl Fn(usize) -> f64, p: impl Fn(usize) -> f64, t: f64, fs: &ForcingSet, g: impl FnOnce(&[f64]) -> R) -> Result<R, String> }

impl Program { pub fn eval_with_extra<R>(&self, u: impl Fn(usize) -> f64, p: impl Fn(usize) -> f64, t: f64, fs: &ForcingSet, extra: &[(usize, &[f64])], g: impl FnOnce(&[f64]) -> R) -> Result<R, String> }

impl Program { pub fn eval(&self, dofs: &Dofs, u: &[f64], t: f64, forcing: &Forcing) -> Result<Vec<f64>, String> }

impl Program { pub fn summand_magnitudes(&self, dofs: &Dofs, vars: &[&str], u: &[f64], t: f64, forcing: &Forcing) -> Result<Vec<f64>, String> }

impl Program { pub fn block<'v>(&self, v: &'v [f64], name: &str) -> Option<&'v [f64]> }

A document’s right-hand side, compiled by EarthSciAST (rhs_program), with the permutation between its own state layout and the canonical order. It may be evaluated from several threads at once: each takes a workspace from a pool (an RhsWorkspace is not Sync).

Source · Rust docs