File: template_driver.rst

package info (click to toggle)
siconos 4.3.1%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 82,496 kB
  • sloc: cpp: 159,693; ansic: 108,665; fortran: 33,248; python: 20,709; xml: 1,244; sh: 385; makefile: 226
file content (48 lines) | stat: -rw-r--r-- 1,180 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
.. _template_siconos_driver:


C++ template for siconos driver
===============================

.. highlight:: c++
	       
.. code::

   // Header file
   #include <SiconosKernel.h>
   using namespace std;
   // main program
   int main(int argc, char* argv[])
   {
   // Exception handling
   try
   {
    // == User-defined parameters ==
    
    // ================= Creation of the model =======================
    
    // == Creation of the NonSmoothDynamicalSystem ==
    // -- DynamicalSystem(s) --
    // -- Interaction --
    // - Relations - 
    // - NonSmoothLaw -
    // -- NonSmoothDynamicalSystem --	
    // == Creation of the Simulation ==
    // -- TimeDiscretisation --
    // -- Simulation (time stepping or event-driven)
    // -- OneStepIntegrator --
    // -- OneStepNSProblem --
    // ================================= Computation =================================

    // --- Time loop ---
  }
  
  // == Catch exceptions ==
  catch(SiconosException e)
    {cout << e.report() << endl;}
  catch(...)
    {cout << "Exception caught in mySample.cpp" << endl;}
  
  // == get elapsed time ==
  cout << "Computation Time " << time.elapsed()  << endl;  
  }