Debugging macros

Debugging macros adds informations on standard output stream (usually displayed on screen). It allows developpers to trace various information during simulations.
They are enabled only when debug build is enabled. They are ignored for other build types.

In order to enable debug build mode, the option -DCMAKE_BUILD_TYPE=Debug must be added to the cmake command (e.g. cmake <path to src> -DCMAKE_BUILD_TYPE=Debug).

cmake .. -DCMAKE_BUILD_TYPE=Debug

This debug build mode can be disabled using the release mode, with the option -DCMAKE_BUILD_TYPE=Release.

The following macros are available for debugging:


Example:

 bool runStep(const openfluid::base::SimulationStatus* SimStatus)
{
  openfluid::core::Unit* TU;
  DECLARE_UNITS_ORDERED_LOOP(1);
  openfluid::core::DateTime BeginDate,EndDate;
  openfluid::core::EventsCollection EvColl;

  OFDBG_LOCATE;

  BeginDate = SimStatus->getCurrentTime();
  EndDate = SimStatus->getCurrentTime() + SimStatus->getTimeStep() -1;


  BEGIN_UNITS_ORDERED_LOOP(1,"TU",TU)
     OFDBG_UNIT_EXTENDED(TU);    

     EvColl.clear();
     OPENFLUID_GetEvents(TU,BeginDate,EndDate,EvColl);
     OFDBG_EVENTCOLLECTION(EvColl);
  END_LOOP

  return true;
}

Generated using Doxygen 1.7.6.1
Creative Commons License Creative Commons By-NC-ND license