"SfR Fresh" - the SfR Freeware/Shareware Archive

Member "root/tutorials/foam/README" of archive root_v5.20.00.win32.tar.gz:


As a special service "SfR Fresh" has tried to format the requested source page into HTML format using source code syntax highlighting with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. That can be also achieved for any archive member file by clicking within an archive contents listing on the first character of the file(path) respectively on the according byte size field.
    1 1) What is FOAM ?
    2 
    3 FOAM is simplified version of multi-dimensional general 
    4 purpose Monte Carlo event generator (integrator) with hyper-cubical
    5 "foam of cells". Certain features of full version of FOAM are omitted.
    6 mFOAM is intended  as an easy to use tool for MC
    7 simulation/integration in few dimensions. It relies heavily on ROOT package, 
    8 borrowing persistency of classes from ROOT. mFOAM can be easily used from
    9 the ROOT shell. For more difficult problems the full FOAM may be better.
   10 
   11 2) How to run application programs ?
   12 
   13 The application program can be run in two modes: it can be simply
   14 intepreted by CINT or compiled. The first method is simpler but
   15 results in slower execution. The second method employs ACLiC -
   16 The Automatic Compiler of Libraries, which automaticates the
   17 process of compilation and linking.
   18 
   19 In $(ROOTSYS)/tutorials there are 3 demonstration programs:
   20 
   21 (a) foam_kanwa.C 
   22 is a simple example how to run FOAM in interactive 
   23 mode. To run this macro issue the  following simple command from the 
   24 Linux shell:
   25   root foam_kanwa.C
   26 or from CINT:
   27   root [0] .x foam_kanwa.C
   28 Simulation will start and graphical canvas with plot
   29 of the distribution fuction appear. In this example 
   30 we defined the distribution function simply as a global
   31 function function Camel2.
   32 
   33 (b) foam_demo.C 
   34 shows usage of FOAM in compiled mode, which is 
   35 the preferred method.  The integrand function is defined
   36 now as a Density method from class TFDISTR inheriting from
   37 abstract class  TFoamIntegrand. User can modify interface to
   38 integrand function according to his needs but he should
   39 always remember to define Density  method which provides the
   40 density distribution.
   41 Enter CINT interpreter and type: 
   42   root [0] gSystem->Load("libFoam.so")
   43   root [1] .x foam_demo.C+
   44 to load FOAM library, compile and execute macro foam_demo.C.
   45 A shared object foam_demo_C.so is created in the current 
   46 directory. At the end of exploration phase FOAM object 
   47 including distribution function will be written to disk.
   48 
   49 (c) foam_demopers.C 
   50 demonstrates persistency of FOAM classes.
   51 To run this macro type:
   52   root [0] .x foam_demopers.C
   53 Program reads the FOAM object from disk, checks its 
   54 consistency and prints geometry of cells. Next starts the
   55 the generation. It can be interpreted directly by CINT
   56 because compiled TFDISTR class is already available in 
   57 foam_demo_C.so library.