FAQ
From OpenFLUID
General information
What is OpenFLUID?
OpenFLUID is a software environment for modelling spatialized fluxes in landscapes. It is made of the OpenFLUID framework, OpenFLUID software applications, and uses simulation functions.
See the OpenFLUID overview for more details.
What are OpenFLUID simulation functions?
OpenFLUID simulation functions are computational codes ("simulators") which can be dynamically plugged to the OpenFLUID framework in order to realize coupled models adapted to the modelling context and objectives, and then run simulations based on these coupled models.
See the simulation functions overview for more details.
What is the OpenFLUID license?
OpenFLUID is distributed under the GPLv3 license, with a special exception allowing to develop simulation functions that are not distributed under a GPL-flavored license.
See the OpenFLUID license page for license text.
On which operating systems OpenFLUID is available?
OpenFLUID works on Linux, Windows and MacOSX systems. It is developed on linux system, and has been tested under Linux Ubuntu (32-64bits), Linux CentOS (64bits), WinXP and Win7 (32-64bits), MacOSX 10.5. It should run on other compatibles operating systems.
It is distributed as binary packages for Ubuntu linux and Windows (See here), but can be rebuilt from sources (See here)
As far as possible, we recommend to run OpenFLUID on linux systems as it our development system.
I need help about OpenFLUID, what can I do?
First of all, you are really encouraged to read the OpenFLUID Documentation.
You can also get help from the OpenFLUID community using the mailing-list or the IRC channel. See the Community support page for details.
I found a bug or I would like to suggest a feature, what should I do?
You can report a bug or suggest a new feature by filling a New Ticket on the SourceForge ticket system. See the Community support page for details.
Installation
How do I get the latest OpenFLUID packages for installation?
The latest OpenFLUID packages are available from the OpenFLUID downloads page
How do I get the current source code and build OpenFLUID?
You can get the current OpenFLUID source code from our subversion repository using the following command:
svn co https://openfluid.svn.sourceforge.net/svnroot/openfluid/openfluid/trunk
This source code can be built following the build instructions.
Using OpenFLUID
How do I add paths to search for simulation functions?
When using the openfluid-engine application, this can be done using the "-p" command line option. In this case, the added paths are enabled for the current launched simulation.
When using the openfluid-builder application, this can be done through the preferences dialog box. In this case, the added paths are persistant until they are removed from the preferences.
How to get more details about the simulations executions?
When using the openfluid-engine application, you can use the "-v" command line option to get a verbose run.
You can also use the "-k" command line option to enable profiling mode giving information about the time spent in the different part of the simulation. The profiling results are stored in the profile.dat and profile_steps.dat files, located in the output directory.
Finally, you can consult the simulation functions log files located in the output directory.
Development of simulation functions
How do I create and build a new simulation function?
See the Create and build a simulation function page.
What coding style should I use for writing source code?
The best coding style for your simulation functions development is the coding style you are familiar with, as far as it is shared and applied in the work group you are belonging to. If you are not using a specific coding style, we recommend to use the OpenFLUID coding style.
How can I log information messages during simulations?
You can log informations from your simulation functions using the OpenFLUID Logger system. This is the recommended way to log messages. Please avoid using std::cout or std::cerr.
For details, see the "Guide for developing simulation functions, with API reference" from OpenFLUID Documentation, and go to the "Logs, Warnings, Errors" section.
How can I raise warnings and error during simulations?
Warning and errors are messages that cab be raised during the simulation. A warning lets the simulation continue, an error stops the simulation the next time the OpenFLUID framework takes the control. Error and warnings are logged into the siminfo.out file located in the output directory.
Usage:
- OPENFLUID_RaiseWarning(std::string Sender, int TimeStep, std::string WarningMsg) for dated warning
- OPENFLUID_RaiseWarning(std::string Sender, std::string WarningMsg) for undated warning
- OPENFLUID_RaiseError(std::string Sender, int TimeStep, std::string WarningMsg) for dated error
- OPENFLUID_RaiseError(std::string Sender, std::string WarningMsg) for undated error
bool FAQFunction::runStep(const openfluid::base::SimulationStatus* SimStatus) { // local variables declaration int ID; openfluid::core::ScalarValue TmpValue; openfluid::core::ScalarValue ResultValue; openfluid::core::Unit* UU; DECLARE_SU_ORDERED_LOOP(1); // get time step and current step int TimeStep = SimStatus->getTimeStep(); int CurrentStep = SimStatus->getCurrentStep(); BEGIN_SU_ORDERED_LOOP(1,"SU", UU) ID = UU->getID(); OPENFLUID_GetVariable(UU,"input_var",CurrentStep,&TmpValue); if (TmpValue > 0) { ResultValue = 1/TmpValue; OPENFLUID_AppendVariable(UU,"output_var",ResultValue); } else { OPENFLUID_RaiseError("FAQfunction",CurrentStep,"input_var is 0"); return false; } END_LOOP return true; }
For details, see the "Guide for developing simulation functions, with API reference" from OpenFLUID Documentation, and go to the "Logs, Warnings, Errors" section.
How can I store data and status from one time step to the next time step?
In this case, you can use "ID-maps" structures as attribute of your function C++ class.
For details, see the "Guide for developing simulation functions, with API reference" from OpenFLUID Documentation, and go to the "Internal function status and data" section.
Troubleshooting
How can I resolve the "Too many open files" error?
This error is due to operating system limitations. It often occurs when a lot of simulation results are set to be saved to files.
It can be resolved by limiting the number of outputs by adapting the outputs configuration.
The other method is to modify the operating system configuration (when possible).
On linux systems, this limitation can be disabled by adding the following lines to the /etc/security/limits.conf file
* soft nofile 65535 * hard nofile 65535
