Skip to content

FEBio

See FEBio workflows for template contexts and solver integration. The helper renders files; it does not validate models or run the solver.

Render FEBio input files from templates and explicit simulation contexts.

create_feb_files

create_feb_files(feb_template, feb_data, output_dir, *, overwrite=False)

Render XML-escaped contexts with strict, sandboxed Jinja2 evaluation.

Parameters:

Name Type Description Default
feb_template Path

UTF-8 Jinja2 FEBio template. Includes resolve beside it.

required
feb_data Mapping[str, Mapping[str, object]]

Template context for each portable simulation identifier.

required
output_dir Path

Directory for generated FEBio files.

required
overwrite bool

Explicitly allow replacing existing regular output files.

False

Raises:

Type Description
ValueError

An identifier is unsafe or an output is a symbolic link.

FileExistsError

An output exists and overwrite is false.

TemplateError

Template compilation or rendering fails.

Templates must still be reviewed and contexts must contain trusted data. Sandboxing does not limit CPU, memory, or calls on user-supplied objects.