Manual for OpenFLUID 2.1.11

Documenting your simulators

The scientific documentation of simulators is important to clearly describe the scientific concepts and methods applied in source code of simulators. In order to facilitate the writing and maintenance of these documentation, OpenFLUID provides the Sim2Doc system for simulators designers and developers.

The Sim2Doc system uses the simulator signature and an optional LaTeX -formatted text to build a PDF or HTML document. The LaTeX -formatted text can be placed in the main file of the simulator source code, into a single C++ comment block, and between the <sim2doc> and </sim2doc> tags.

Example of a part of source code including sim2doc informations:

/*
<sim2doc>
This part of the documentation will be included in the
It can be formatted using \LaTeX and is fully compatible with all \LaTeX commands,
including tables, scientific formulae, figures, and many more.
</sim2doc>
*/
BEGIN_SIMULATOR_SIGNATURE("help.snippets.sim2doc")
DECLARE_NAME("Example simulator");
DECLARE_DESCRIPTION("This simulator is an example");
DECLARE_VERSION("13.05");
DECLARE_AUTHOR("John","john@foobar.org");
DECLARE_AUTHOR("Dave","dave@foobar.org");
DECLARE_AUTHOR("Mike","mike@foobar.org");
DECLARE_REQUIRED_PARAMETER("meanspeed","mean speed to use","m/s")
DECLARE_REQUIRED_ATTRIBUTE("area","TU","area of the Test Units","m")
DECLARE_USED_ATTRIBUTE("landuse","OU","landuse of the Other Units","")
DECLARE_REQUIRED_VARIABLE("varA[double]","TU","","m")
DECLARE_USED_VARIABLE("varB","OU","simple var on Other Units","kg")
DECLARE_PRODUCED_VARIABLE("VarB[vector]","TU","vectorized var on Test Units","kg")
DECLARE_UPDATED_VARIABLE("VarC","TU","","")


The final document can be generated using the OpenFLUID Sim2Doc buddy, included in the OpenFLUID command line program. See also Buddies command line for available options.

Example of OpenFLUID command line to generate the PDF document using the Sim2Doc tool:

openfluid buddy sim2doc -o inputcpp=MySimFile.cpp,pdf=1
DECLARE_NAME
#define DECLARE_NAME(name)
Definition: WareSignatureMacros.hpp:55
BEGIN_SIMULATOR_SIGNATURE
#define BEGIN_SIMULATOR_SIGNATURE(id)
Definition: SimulatorSignatureMacros.hpp:58
DECLARE_USED_ATTRIBUTE
#define DECLARE_USED_ATTRIBUTE(name, uclass, description, unit)
Definition: SimulatorSignatureMacros.hpp:346
DECLARE_AUTHOR
#define DECLARE_AUTHOR(name, email)
Definition: WareSignatureMacros.hpp:85
DECLARE_DESCRIPTION
#define DECLARE_DESCRIPTION(desc)
Definition: WareSignatureMacros.hpp:70
DECLARE_REQUIRED_PARAMETER
#define DECLARE_REQUIRED_PARAMETER(name, description, unit)
Definition: SimulatorSignatureMacros.hpp:173
DECLARE_VERSION
#define DECLARE_VERSION(version)
Definition: WareSignatureMacros.hpp:100
DECLARE_USED_VARIABLE
#define DECLARE_USED_VARIABLE(name, uclass, description, unit)
Definition: SimulatorSignatureMacros.hpp:278
openfluid
Definition: ApplicationException.hpp:47
DECLARE_PRODUCED_VARIABLE
#define DECLARE_PRODUCED_VARIABLE(name, uclass, description, unit)
Definition: SimulatorSignatureMacros.hpp:199
DECLARE_REQUIRED_VARIABLE
#define DECLARE_REQUIRED_VARIABLE(name, uclass, description, unit)
Definition: SimulatorSignatureMacros.hpp:252
openfluid::ware::EXPERIMENTAL
@ EXPERIMENTAL
Definition: TypeDefs.hpp:106
DECLARE_USED_EVENTS
#define DECLARE_USED_EVENTS(uclass)
Definition: SimulatorSignatureMacros.hpp:364
DECLARE_UPDATED_VARIABLE
#define DECLARE_UPDATED_VARIABLE(name, uclass, description, unit)
Definition: SimulatorSignatureMacros.hpp:225
END_SIMULATOR_SIGNATURE
#define END_SIMULATOR_SIGNATURE
Definition: SimulatorSignatureMacros.hpp:73
DECLARE_STATUS
#define DECLARE_STATUS(status)
Definition: WareSignatureMacros.hpp:133
DECLARE_REQUIRED_ATTRIBUTE
#define DECLARE_REQUIRED_ATTRIBUTE(name, uclass, description, unit)
Definition: SimulatorSignatureMacros.hpp:325