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
Machineusing 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.solverbaseand implement all required methods correctely. Of particular importance isgetMachineas it is used by this method to create a newMachineon 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
getMachineto obtain aMachineinstance of the solver. It than executes the Machine with using theRESULTStarget (seeMachinefor infos about different targets). This method is blocking, it waits for the solver to finished before returning. Be aware ofMachinecaching 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.solverbaseand implement all required methods correctely. Of particular importance isgetMachineas it is used by this method the get theMachineused 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
Nonethe 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.