hecate-lib 0.2.2

A library for generating simulation code from a mathematical problem description!
Documentation
1
{"$defs":{"Condition":{"anyOf":[{"$ref":"#/$defs/Quantity<time>"},{"pattern":"^\\s*([+-]?[\\d_ ]*\\.?[\\d_ ]+?(?:e(?:\\+|-)?[.\\d]+)?)[ \\t]*([^\\d\\s.](?:.*?[^.])?)?\\s*\\s*..\\s*\\s*([+-]?[\\d_ ]*\\.?[\\d_ ]+?(?:e(?:\\+|-)?[.\\d]+)?)[ \\t]*([^\\d\\s.](?:.*?[^.])?)?\\s*$","type":"string"}]},"Condition2":{"anyOf":[{"$ref":"#/$defs/Quantity<length>"},{"pattern":"^\\s*([+-]?[\\d_ ]*\\.?[\\d_ ]+?(?:e(?:\\+|-)?[.\\d]+)?)[ \\t]*([^\\d\\s.](?:.*?[^.])?)?\\s*\\s*..\\s*\\s*([+-]?[\\d_ ]*\\.?[\\d_ ]+?(?:e(?:\\+|-)?[.\\d]+)?)[ \\t]*([^\\d\\s.](?:.*?[^.])?)?\\s*$","type":"string"}]},"ConditionedFunctionExpression":{"properties":{"expr":{"$ref":"#/$defs/FunctionExpression"},"t":{"anyOf":[{"$ref":"#/$defs/Condition"},{"type":"null"}],"description":"The time condition for which the function expression is valid.\nIt can be none, a value or a range.","title":"Time Condition"},"x":{"anyOf":[{"$ref":"#/$defs/Condition2"},{"type":"null"}],"description":"The x condition for which the function expression is valid.\nIt can be none, a value or a range.","title":"X Condition"},"y":{"anyOf":[{"$ref":"#/$defs/Condition2"},{"type":"null"}],"description":"The y condition for which the function expression is valid.\nIt can be none, a value or a range.","title":"Y Condition"},"z":{"anyOf":[{"$ref":"#/$defs/Condition2"},{"type":"null"}],"description":"The z condition for which the function expression is valid.\nIt can be none, a value or a range.","title":"Z Condition"}},"required":["expr"],"type":"object"},"FiniteElement":{"description":"The finite element to use for the mesh.","enum":["Q1","Q2","Q3"],"title":"Finite Element","type":"string"},"FunctionDef":{"anyOf":[{"$ref":"#/$defs/FunctionExpression"},{"description":"A function defined as list of function expression with conditions (time range, space range, etc...).\nThe function expressions are checked in order. Therefore, in case of an overlap, the first one will be used.\nIf no function expressions without conditions are specified, a default value of 0 will be assumed.","items":{"$ref":"#/$defs/ConditionedFunctionExpression"},"title":"Conditioned Function","type":"array"}],"description":"The definition of a function.\nThis can be an expression or a conditioned function.","title":"Function Definition"},"FunctionExpression":{"description":"A function expression.\nAvailable variables are : t, x, y, z.\nMath functions such as cosinus or exponentials are available.\nThey can be called through their cpp names like log for the logarithm.","oneOf":[{"type":"string"},{"type":"number"}],"title":"Function Expression"},"GenConfig":{"description":"The configuration for the generation of the code.","properties":{"matrix_free":{"default":false,"description":"Whether to generate matrix free code.","title":"Matrix Free","type":"boolean"},"mpi":{"default":false,"description":"Whether to generate MPI code.","title":"MPI","type":"boolean"}},"title":"Generation Configuration","type":"object"},"HyperCubeMesh":{"properties":{"range":{"default":"0 m .. 1 m","pattern":"^\\s*([+-]?[\\d_ ]*\\.?[\\d_ ]+?(?:e(?:\\+|-)?[.\\d]+)?)[ \\t]*([^\\d\\s.](?:.*?[^.])?)?\\s*\\s*..\\s*\\s*([+-]?[\\d_ ]*\\.?[\\d_ ]+?(?:e(?:\\+|-)?[.\\d]+)?)[ \\t]*([^\\d\\s.](?:.*?[^.])?)?\\s*$","type":"string"},"show_info":{"default":false,"type":"boolean"},"subdivisions":{"default":5,"format":"uint","minimum":0,"type":"integer"}},"type":"object"},"Map<string, Equation>":{"additionalProperties":{"pattern":"^[^=]+=[^=]+$","type":"string"},"type":"object"},"Map<string, FunctionDef>":{"additionalProperties":{"$ref":"#/$defs/FunctionDef"},"type":"object"},"Map<string, MeshEnum>":{"additionalProperties":{"$ref":"#/$defs/MeshEnum"},"type":"object"},"Map<string, QuantityEnum>":{"additionalProperties":{"$ref":"#/$defs/QuantityEnum"},"type":"object"},"Map<string, Unknown>":{"additionalProperties":{"$ref":"#/$defs/Unknown"},"type":"object"},"MeshEnum":{"oneOf":[{"$ref":"#/$defs/HyperCubeMesh","properties":{"type":{"const":"hyper_cube","type":"string"}},"required":["type"],"type":"object"}]},"Quantity<length>":{"description":"A length (default_unit: m).","oneOf":[{"pattern":"^\\s*(reference|ref)?\\s*([+-]?[\\d_ ]*\\.?[\\d_ ]+?(?:e(?:\\+|-)?[.\\d]+)?)[ \\t]*([^\\d\\s.](?:.*?[^.])?)?\\s*$","type":"string"},{"type":"number"}],"title":"Length"},"Quantity<speed>":{"description":"A speed (default_unit: m).","oneOf":[{"pattern":"^\\s*(reference|ref)?\\s*([+-]?[\\d_ ]*\\.?[\\d_ ]+?(?:e(?:\\+|-)?[.\\d]+)?)[ \\t]*([^\\d\\s.](?:.*?[^.])?)?\\s*$","type":"string"},{"type":"number"}],"title":"Speed"},"Quantity<time>":{"description":"A time (default_unit: s).","oneOf":[{"pattern":"^\\s*(reference|ref)?\\s*([+-]?[\\d_ ]*\\.?[\\d_ ]+?(?:e(?:\\+|-)?[.\\d]+)?)[ \\t]*([^\\d\\s.](?:.*?[^.])?)?\\s*$","type":"string"},{"type":"number"}],"title":"Time"},"QuantityEnum":{"oneOf":[{"properties":{"type":{"const":"speed","type":"string"},"value":{"$ref":"#/$defs/Quantity<speed>"}},"required":["type","value"],"type":"object"}],"title":"Quantity"},"Solve":{"description":"The equation(s) to solve and the mesh to use.","properties":{"element":{"$ref":"#/$defs/FiniteElement"},"equations":{"description":"The equation(s) to solve","items":{"type":"string"},"title":"Equations","type":"array"},"mesh":{"description":"The mesh to use","title":"Mesh","type":"string"},"time":{"description":"The time range to solve.","pattern":"^\\s*([+-]?[\\d_ ]*\\.?[\\d_ ]+?(?:e(?:\\+|-)?[.\\d]+)?)[ \\t]*([^\\d\\s.](?:.*?[^.])?)?\\s*\\s*..\\s*\\s*([+-]?[\\d_ ]*\\.?[\\d_ ]+?(?:e(?:\\+|-)?[.\\d]+)?)[ \\t]*([^\\d\\s.](?:.*?[^.])?)?\\s*$","title":"Time","type":"string"},"time_step":{"$ref":"#/$defs/Quantity<time>","description":"The time step to use.","title":"Time Step"}},"required":["equations","mesh","element","time","time_step"],"title":"Solve","type":"object"},"Unknown":{"description":"Represents an unknown to be solved in the PDE.","properties":{"boundary":{"anyOf":[{"$ref":"#/$defs/UnknownProperty"},{"type":"null"}],"description":"The boundary condition of the unknown.","title":"Boundary Condition"},"derivative":{"anyOf":[{"$ref":"#/$defs/Unknown"},{"type":"null"}],"description":"The derivative's conditions of the unknown.","title":"Derivative Conditions"},"initial":{"$ref":"#/$defs/UnknownProperty","description":"The initial value of the unknown.","title":"Initial Condition"}},"required":["initial"],"title":"Unknown","type":"object"},"UnknownProperty":{"anyOf":[{"format":"int64","type":"integer"},{"format":"double","type":"number"},{"type":"string"}]}},"$schema":"https://json-schema.org/draft/2020-12/schema","description":"The input schema for Hecate.","properties":{"equations":{"$ref":"#/$defs/Map<string, Equation>","description":"The available equations.","title":"Equations"},"functions":{"$ref":"#/$defs/Map<string, FunctionDef>","description":"The available functions.\nThey can either be simple function expression, or a list of function expression with conditions.","title":"Functions"},"generation":{"$ref":"#/$defs/GenConfig","default":{"matrix_free":false,"mpi":false}},"meshes":{"$ref":"#/$defs/Map<string, MeshEnum>","description":"The available meshes.","title":"Meshes"},"parameters":{"$ref":"#/$defs/Map<string, QuantityEnum>","description":"The available parameters.","title":"Parameters"},"solve":{"$ref":"#/$defs/Solve"},"unknowns":{"$ref":"#/$defs/Map<string, Unknown>","description":"The available unknowns.","title":"Unknowns"}},"required":["meshes","equations","parameters","unknowns","functions","solve"],"title":"Hecate Input Schema","type":"object"}