QuickField Problem Builder
ProblemBuilder 1.4.0 reads a .qfp JSON Lines script and creates a QuickField problem file (.pbm). It is the root builder and orchestrator for complete QuickField problems.
ProblemBuilder sets the problem type, class, units, timing parameters, and references to the geometry and data files. It can then run Model Builder and Data Builder through their run(filename) entry points.
ProblemBuilder does not read .qfs or .qfd files directly, does not create .mod or data files itself, and does not change the process working directory.
The source code, precompiled executable, and full PDF documentation are available in the download section.
Program launch options
Problem Builder can be started with or without command-line parameters:
problem_builder.exe [/h] [filepath]
/h– displays a list of supported script commands.filepath– loads the specified.qfpscript.
If problem_builder.exe is launched without parameters, it opens a graphical user interface where the user can choose a script file manually.
QFP script format and version
A Problem Builder script (.qfp) is a plain-text UTF-8 JSON Lines file: every non-empty line contains one JSON object representing one command.
{"version":"1.2"}
Supported QFP versions are 1.0 and 1.2. The current recommended version is 1.2.
Command reference
analysis – problem type
{"analysis":"code"}
| Code | Analysis type | Referenced data file |
|---|---|---|
ms | DC Magnetics | .dms |
tem | Transient Magnetics | .dms |
he | AC Magnetics | .dhe |
es | Electrostatics | .des |
dc | DC Conduction | .dcf |
ec | AC Conduction | .dec |
tv | Transient Electric | .dtv |
sa | Stress Analysis | .dsa |
sht | Steady-State Heat Transfer | .dht |
tht | Transient Heat Transfer | .dht |
Transient Magnetics: use {"analysis":"tem"} in the .qfp script, but use {"analysis":"ms"} in the corresponding .qfd script.
problemClass
{"problemClass":"plane-parallel"}
{"problemClass":"axisymmetric"}
units and coordinates
{"units":"mm"}
{"coordinates":"cartesian"}
Optional problem parameters
| Command | Description |
|---|---|
{"frequency":60} | Frequency in hertz for AC problems. |
{"ZLength":100} | Axial length for plane-parallel problems. It is not required for axisymmetric problems. |
Transient timing parameters
| Command | Description |
|---|---|
{"timeFinal":0.001} | End time of the simulation. |
{"autoTimeStep":false} | Disables automatic time stepping. |
{"timeStep":0.000001} | Fixed time-step size. |
{"timeOutputFirst":0} | First output time. |
{"timeOutputStep":0.000002} | Output time interval. |
modelFile and dataFile
{"modelFile":"example.mod"}
{"dataFile":"example.dms"}
These commands simply link the geometry and data files to the .pbm problem document for ProblemBuilder.
They do not generate these files or run Model/Data Builders, meaning the referenced files do not need to exist yet.
The data-file extension depends on the analysis type. Transient Magnetics uses .dms, Transient Electric uses .dtv, and Transient Heat Transfer uses .dht.
modelBuilder and dataBuilder
{"modelBuilder":"example.qfs"}
{"dataBuilder":"example.qfd"}
These commands queue builder scripts. The commands are queued when read and executed only when save is reached. Relative builder-script paths are resolved relative to the directory containing the .qfp script.
modelBuilder and dataBuilder must appear before save.
save – must be last
{"save":"example.pbm"}
{"save":{"file":"example.pbm","solve":{}}}
save creates the .pbm problem file, sets its referenced geometry and data files, and then runs all queued builder scripts.
The
solve field is optional; when present, it starts the solver asynchronously after the .pbm file has been saved with its referenced files and the queued modelBuilder/dataBuilder scripts have produced the .mod and data files.
save must always be the last command in the .qfp file. Any modelBuilder or dataBuilder commands after save will not run.
Include the .pbm extension explicitly.
Execution order inside save
pbm.SaveAs(file)– creates the.pbmfile.pbm.SetReferencedFile(0, modelFile)– links the.modfile.pbm.SetReferencedFile(1, dataFile)– links the data file.pbm.Save()– saves the updated references.run_pending_builders()– runs all queuedmodelBuilderanddataBuilderscripts.
Complete QFP templates
DC Magnetics, axisymmetric
{"version":"1.2"}
{"analysis":"ms"}
{"problemClass":"axisymmetric"}
{"units":"mm"}
{"coordinates":"cartesian"}
{"modelFile":"example.mod"}
{"dataFile":"example.dms"}
{"modelBuilder":"example.qfs"}
{"dataBuilder":"example.qfd"}
{"save":"example.pbm"}
Transient Magnetics, axisymmetric
{"version":"1.2"}
{"analysis":"tem"}
{"problemClass":"axisymmetric"}
{"units":"mm"}
{"coordinates":"cartesian"}
{"timeFinal":0.001}
{"autoTimeStep":false}
{"timeStep":0.000001}
{"timeOutputFirst":0}
{"timeOutputStep":0.000002}
{"modelFile":"example.mod"}
{"dataFile":"example.dms"}
{"modelBuilder":"example.qfs"}
{"dataBuilder":"example.qfd"}
{"save":"example.pbm"}
Current source-package layout
The current source package has a flat layout. Keep these Python files together in one directory:
problem_builder.py
model_builder.py
data_builder.py
qf_data_builder_common.py
qf_data_builder_*.py
ProblemBuilder imports model_builder and data_builder directly from the same directory. Separate model_builder/ or data_builder/ source subdirectories are not required.
ProblemBuilder creates and saves the .pbm file, writes the file references, and then calls the queued Model Builder and Data Builder scripts.
It does not close QuickField problem windows; the problem remains open for inspection or solving.
Check or create a QFP script
The checker below validates JSON syntax, recognized commands, required file references, common extensions, and the rule that save must be last. It does not run QuickField or the builder programs.
- Accept terms above and download:
Source code and precompiled executable - Full documentation (PDF)