pub struct InputSchema {
pub gen_conf: GenConfig,
pub meshes: IndexMap<String, MeshEnum>,
pub equations: IndexMap<String, Equation>,
pub parameters: IndexMap<String, QuantityEnum>,
pub unknowns: IndexMap<String, Unknown>,
pub functions: IndexMap<String, FunctionDef>,
pub solve: Solve,
}Expand description
§Hecate Input Schema
The input schema for Hecate.
Fields§
§gen_conf: GenConfig§meshes: IndexMap<String, MeshEnum>§Meshes
The available meshes.
equations: IndexMap<String, Equation>§Equations
The available equations.
parameters: IndexMap<String, QuantityEnum>§Parameters
The available parameters.
unknowns: IndexMap<String, Unknown>§Unknowns
The available unknowns.
functions: IndexMap<String, FunctionDef>§Functions
The available functions. They can either be simple function expression, or a list of function expression with conditions.
solve: SolveImplementations§
Source§impl InputSchema
impl InputSchema
pub fn validate(&self) -> Result<(), SchemaValidationError>
Sourcepub fn generate_sources(&self) -> Result<CodeGenRes, CodeGenError>
pub fn generate_sources(&self) -> Result<CodeGenRes, CodeGenError>
Examples found in repository?
examples/heat-eq.rs (line 12)
4fn main() -> Result<()> {
5 env_logger::builder()
6 .filter_level(log::LevelFilter::Info)
7 .parse_default_env()
8 .init();
9 let schema: InputSchema =
10 serde_yaml::from_str(include_str!("../input-schemas/heat-eq.hecate.yml"))?;
11
12 let sources = schema.generate_sources()?;
13
14 sources.write_to_dir("build/example-heat-eq")?;
15
16 Ok(())
17}More examples
examples/wave-eq.rs (line 13)
4fn main() -> Result<()> {
5 env_logger::builder()
6 .filter_level(log::LevelFilter::Info)
7 .format_timestamp(None)
8 .parse_default_env()
9 .init();
10 let schema: InputSchema =
11 serde_yaml::from_str(include_str!("../input-schemas/wave-eq.hecate.yml"))?;
12
13 let res = schema.generate_sources()?;
14
15 res.write_to_dir("build/example-wave-eq")?;
16
17 Ok(())
18}pub fn generate_cpp_sources(&self) -> Result<String, CodeGenError>
Trait Implementations§
Source§impl Clone for InputSchema
impl Clone for InputSchema
Source§fn clone(&self) -> InputSchema
fn clone(&self) -> InputSchema
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for InputSchema
impl Debug for InputSchema
Source§impl<'de> Deserialize<'de> for InputSchema
impl<'de> Deserialize<'de> for InputSchema
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl JsonSchema for InputSchema
impl JsonSchema for InputSchema
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreAuto Trait Implementations§
impl Freeze for InputSchema
impl !RefUnwindSafe for InputSchema
impl Send for InputSchema
impl Sync for InputSchema
impl Unpin for InputSchema
impl !UnwindSafe for InputSchema
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more