Salome HOME
Increment version: 9.11.0
[samples/sierpinsky.git] / README
1 ******************************
2 About SALOME SIERPINSKY sample
3 ******************************
4
5 SIERPINSKY is a simple example of SALOME module written in C++ and
6 implementing services via CORBA interface. It works in conjunction
7 with SALOME RANDOMIZER sample module; with latter it interfers by means
8 of CORBA services (see below).
9
10 RANDOMIZER and SIERPINSKY modules implement simple interface to calculate
11 Sierpinsky fields.
12
13 For more information please visit the SALOME platform web site:
14
15   <http://www.salome-platform.org/>
16
17 =======
18 License
19 =======
20
21 SALOME platform is distributed under the GNU Lesser General Public License.
22 See COPYING file for more details.
23
24 Also, additional information can be found at SALOME platform web site:
25
26   <http://www.salome-platform.org/downloads/license/>
27
28 ============
29 Installation
30 ============
31
32 --------------
33 Pre-requisites
34 --------------
35
36 SALOME platform relies on a set of third-party softwares; some of them are needed
37 at build time only, while other ones are needed in runtime also.
38
39 For more information about the pre-requisites please visit SALOME platform web
40 site:
41
42 * Check Release Notes and Software Requirements of the latest SALOME release at
43
44   <http://www.salome-platform.org/downloads/current-version/>
45
46 * Pre-requisites page at SALOME web site:
47
48   <http://www.salome-platform.org/downloads/license/>
49
50 Note: SALOME SIERPINSKY needs SALOME KERNEL, SALOME GUI, SALOME RANDOMIZER and,
51 optionally, SALOME Mesh modules as pre-requisites.
52
53 ------------------
54 Basic Installation
55 ------------------
56
57 The build procedure of the SALOME platform is implemented with CMake.
58 In order to build the module you have to do the following actions:
59
60 1. Set up environment for pre-requisites (see "Pre-requisites" section above).
61
62 2. Create a build directory:
63
64    % mkdir SIERPINSKY_BUILD
65
66 3. Configure the build procedure:
67
68    % cd SIERPINSKY_BUILD
69    % cmake -DCMAKE_BUILD_TYPE=<mode> -DCMAKE_INSTALL_PREFIX=<installation_directory> <path_to_src_dir>
70
71    where
72    - <mode> is either Release or Debug (default: Release);
73    - <installation_directory> is a destination folder to install SALOME SIERPINSKY
74      module (default: /usr);
75    - <path_to_src_dir> is a path to the SALOME SIERPINSKY sources directory.
76
77    Note: by default (if CMAKE_INSTALL_PREFIX option is not given), SALOME SIERPINSKY
78    module will be configured for installation to the /usr directory that requires
79    root permissions to complete the installation.
80
81 4. Build and install:
82
83    % make
84    % make install
85
86    This will install SALOME SIERPINSKY module to the <installation_directory>
87    specified to cmake command on the previous step.
88
89 -------------------
90 Custom installation
91 -------------------
92
93 SALOME SIERPINSKY module supports a set of advanced configuration options;
94 for more details learn CMakeLists.txt file in the root source directory.
95
96 You can also use other options of cmake command to customize your installation.
97 Learn more about available options by typing
98
99    % cmake --help
100
101 =============
102 Functionality
103 =============
104
105 * RANDOMIZER module
106
107 SALOME RANDOMIZER module is implemented as pure Python module. It does not have
108 any GUI. The IDL interface includes two methods:
109
110 - void InitPoint( out double theX, out double theY );
111
112   to generate a random 2D point; X and Y coordinates are in [0,1) range;
113
114 - long NextIteration();
115
116   to calculate next random iteration step: the integer value in range {1,3}.
117
118 The functionality of this module is used by SIERPINSKY module to calculate
119 Sierpinsky fields.
120
121 * SIERPINSKY module
122
123 The engine interface includes the following methods:
124
125 - void Init( in double X1, in double Y1, in double X2, in double Y2, in double X3,
126              in double Y3 );
127
128   to initialize the engine with three points which will be used as reference points
129   in the calculations;
130
131 - void Reset();
132
133   to initializes the engine with three default reference points: (0.5, 1), (0, 0),
134   (1, 0);
135
136 - void NextPoint( in double X, in double Y, in long iter, out double nextX,
137                   out double nextY );
138
139   calculates next iteration point, basing on the previous one and the iteration
140   step given from RANDOMIZER engine; this method is called subsequently in the loop
141   to generate the points cloud;
142
143 - boolean ExportToJPEG( in string fileName, in long size );
144
145   exports the collected points data to the JPEG file;
146
147 - boolean ExportToMED( in string fileName, in double size );
148
149   exports the collected points data to the MED file.
150
151   The Init() and Reset() methods clear the collected points data and prepare engine
152   to the new calculations. The JPEG file can be viewed with help of any image viewer
153   supporting JPEG format. The MED files created by ExportToMED() method can be then
154   imported in the SALOME ParaVis module for the visualization (see below).
155
156 =====
157 Usage
158 =====
159
160 * Start SALOME:
161
162    ${KERNEL_ROOT_DIR}/bin/salome/runSalome --modules=SMESH,RANDOMIZER,SIERPINSKY
163
164 * Create new study: menu File - New
165
166 * Activate SIERPINSKY module: click the corresponding button on the 'Components' toolbar
167   or select it in the "Components" combo-box.
168
169   The only action of the SIERPINSKY module's GUI is available via 'Sierpinsky' main menu
170   - it is a 'Run' command (there is also corresponding button on the toolbar).
171   This command opens 'Run Sierpinsky Algo' dialog box which allows:
172   - Defining a start point for the calculations; if 'Random' checkbox is turned on, the
173     start point will be generated automatically via RANDOMIZER module functionality.
174   - Defining three reference points for the algo; if 'Random' checkbox is turned on, the
175     reference points will be generated automatically via RANDOMIZER module functionality;
176     if 'Default' checkbox is turned on the default values will be used.
177   - Entering the number of the points to be calculated.
178   - Creating JPEG image after the calculcations are finished; 'Image size' parameter defines
179     the size of the image side in pixels.
180   - Exporting results to the MED file after the calculcations are finished; 'Mesh size'
181     parameter defines the mesh range.
182
183     After pressing the 'Start' button the calculation begins. It is possible to stop the
184     calculation by pressing 'Stop' button. The progress bar in the lower part of the dialog
185     box displays the calculation status.
186
187 ===============
188 Troubleshooting
189 ===============
190
191 Please, send a mail to webmaster.salome@opencascade.com.