Solver Execution¶
The Solver Framework has a great demand for user supplied settings because it interfaces with a lot of external software and every user envrionment is a little bit different. A more sophisticated abbroach than just using FreeCADs Parameter System directely was taken to tackle this problem.
The run
Module¶
Execute Solver and obtain Reports and Results.
Integral part of the Solver Framework which contains components responsible for
executing the solver in the background. Also provides an asynchronous
communication system with the solver running in the background. The purpose of
this module is to be as generic as possible. It can execute every solver
supported by the fem workbench. The threading and communication support is
mainly implemented by the femsolver.task
and femsolver.signal
modules.
-
exception
femsolver.run.
DirectoryDoesNotExistError
¶
-
exception
femsolver.run.
MustSaveError
¶
-
femsolver.run.
getMachine
(solver, path=None)¶ Get or create
Machine
using caching mechanism.- Parameters
solver – A document object which must be a famework complient solver. This means that it should be derived from the document object provided by
femsolver.solverbase
and implement all required methods correctely. Of particular importance isgetMachine
as it is used by this method to create a newMachine
on cache miss.path – A valid filesystem path which shall be associetad with the machine.
-
femsolver.run.
run_fem_solver
(solver, working_dir=None)¶ Execute solver of the solver framwork.
Uses
getMachine
to obtain aMachine
instance of the solver. It than executes the Machine with using theRESULTS
target (seeMachine
for infos about different targets). This method is blocking, it waits for the solver to finished before returning. Be aware ofMachine
caching when using the function.- Parameters
solver – A document object which must be a famework complient solver. This means that it should be derived from the document object provided by
femsolver.solverbase
and implement all required methods correctely. Of particular importance isgetMachine
as it is used by this method the get theMachine
used to execute the solver.working_dir – If specified it overwrites the automatic and user configurable working directory management of the Solver framework. Should always be a absolute path because the location of the binary is not consistent among platforms. If
None
the automatic working directory management is used.
- Note
There is some legacy code to execute the old Calculix solver (pre-framework) which behaives differently because it doesn’t use a
Machine
.