Glossary

This glossary defines the terms used for solve inputs and results. The definitions describe how jcmsuite uses each term.

Project

A JCM project file or template passed to solve. A project with all values filled in uses the .jcmp extension. A project template uses the .jcmpt extension and is rendered before the solve runs. See Solving Projects.

import jcmsuite

result = jcmsuite.solve("project.jcmp")
Ordered project bundle

A solve input that contains more than one project in an ordered sequence. jcmsuite runs the projects in the given order and treats them as one solve unit. A later project can use files produced by an earlier project. See Ordered Project Bundles.

import jcmsuite

bundle = jcmsuite.solve([
    "prepare.jcmp",
    "analyze.jcmp",
])
analysis_result = bundle[1]
Project support file

An input file used with a project while the solve runs. The supported files are layout.jcm, grid.jcm, materials.jcm, sources.jcm, and boundary_conditions.jcm.

jcmsuite can render .jcmt versions of layout.jcm, materials.jcm, sources.jcm, and boundary_conditions.jcm. grid.jcm has no .jcmt variant. See Selecting Project Support Files.

project.jcmp
layout.jcm
materials.mie.jcm
sources.jcm
Templating

The process of rendering a project or project support file from a template. A template can contain JCM text, replacements based on project keys, and Python blocks. jcmsuite renders .jcmt files to .jcm files and .jcmpt files to .jcmp files. See Templating.

A template can contain a printf-style place for a project keys value:

Radius = %(radius)e

Pass the value with keys=:

result = jcmsuite.solve(
    "project.jcmp",
    keys={"radius": 0.33},
)
JCMT pattern

An optional choice for a project support file. For solve("project.jcmp"), the default selects file names without a suffix. For solve("project.jcmp", jcmt_pattern="mie"), the solve selects files such as layout.mie.jcm before layout.jcm. See Selecting Project Support Files.

The JCMT pattern selects both .jcmt templates and plain .jcm files. It does not select project.mie.jcmp as an alternate project start file. project.jcmp remains the project file.

result = jcmsuite.solve(
    "project.jcmp",
    jcmt_pattern="mie",
)
Project keys

Named values used when filling a JCM template. Pass one set of project keys to solve with keys=. The names must match the places for values in the template. See Project Key substitution.

import jcmsuite

project_keys = {"radius": 0.5}
result = jcmsuite.solve("project.jcmp", keys=project_keys)
Batched project keys

A sequence of sets of project keys passed to solve with keys=. The sets are handled in input order, and the result is a BatchSolveResult. See Batched Solves.

import jcmsuite

batched_project_keys = [
    {"radius": 0.3},
    {"radius": 0.4},
    {"radius": 0.5},
]
batch = jcmsuite.solve("project.jcmp", keys=batched_project_keys)
Filter function

A function that receives one set of project keys and returns True when the command must select that Resultbag entry. Pass a filter function to resultbag.management.remove. See Resultbag Management.

resultbag.management.remove(
    filter_function=lambda project_keys: project_keys.get("material") == "Si"
)
Solve results

The values returned by solve or get_results. Solve results can contain data for one project, several sets of project keys, or an ordered project bundle. Use the Working With Results guide to inspect and export this data. See the Result API for the exact return types.

Fieldbag

A native JCMsuite file containing computed field data. A solution fieldbag holds the saved solution used for postprocessing. For main-solve results, file gives the solution fieldbag’s path. See SolveResult Access.

SolveResult

The return type for one project and no or one set of project keys. Use its attributes to access costs, eigenvalues, postprocesses, logs, and result information. See SolveResult and SolveResult Access.

BatchSolveResult

The return type for one project and batched project keys. It preserves the input order and adds batch selection and export behavior. See Batched Results. The API type is BatchSolveResult.

BundledSolveResult

The return type for one ordered project bundle and no or one set of project keys. Select a project to work with its result as a SolveResult. See Bundled Results.

bundle = jcmsuite.solve(["prepare.jcmp", "analyze.jcmp"])
result = bundle[1]
BundledBatchSolveResult

The return type for one ordered project bundle repeated over batched project keys. Select a project to work with its results as a BatchSolveResult. See Bundled Results.

bundle_batch = jcmsuite.solve(
    ["prepare.jcmp", "analyze.jcmp"],
    keys=[{"radius": 0.3}, {"radius": 0.5}],
)
analysis_batch = bundle_batch[1]
Submission

A solve handle sent to a daemon that you complete later with wait. Use a submission when the solve must continue while the code performs other operations. See Submit And Wait.

submission = jcmsuite.solve(
    "project.jcmp",
    dispatch="submit",
)
result = submission.wait()
Resultbag entry

One stored result record in a Resultbag, identified by project keys and an optional JCMT pattern. A Resultbag can contain one entry for each set of project keys and multiple versions with a suffix. See Resultbag.

Resultbag

Storage for solved results and access to saved runs. A Resultbag stores entries in a .jcmrb file and can reuse matching results in later solves. See Resultbag.

import jcmsuite

with jcmsuite.results.Resultbag("results.jcmrb") as resultbag:
    result = jcmsuite.solve(
        "project.jcmp",
        keys={"radius": 0.5},
        resultbag=resultbag,
    )
Base fields

The field values without parameter derivatives in a field export. Base fields do not include derivative fields. Use the base attribute of a FieldExportPayload to access them. See FieldExportPayload and Field Exports.

base_fields = fields.base