Salome HOME
8c4288579ccf209600c36a29485c57002528fddb
[modules/multipr.git] / src / MULTIPR / MULTIPR_API.hxx
1 // Project MULTIPR, IOLS WP1.2.1 - EDF/CS
2 // Partitioning/decimation module for the SALOME v3.2 platform
3
4 /**
5  * \file    MULTIPR_API.hxx
6  *
7  * \brief   Main header of the high level MULTIPR API.
8  *
9  * \author  Olivier LE ROUX - CS, Virtual Reality Dpt
10  * 
11  * \date    01/2007
12  */
13
14 #ifndef MULTIPR_API_HXX
15 #define MULTIPR_API_HXX
16
17
18 namespace multipr
19 {
20
21
22 enum Partitionner
23 {
24         MULTIPR_METIS   = 0,
25         MULTIPR_SCOTCH  = 1
26         
27 }; // enum Partitionner
28
29
30 /**
31  * \fn     const char* getVersion()
32  * \brief  returns the current version of the MULTIPR API.
33  * \return the current version of the MULTIPR API. 
34  */
35 const char* getVersion();
36
37
38 /**
39  * \fn     int partitionneDomaine(const char* medFilename, const char* meshName)
40  * \brief  creates a distributed MED file (v2.3) by extracting all the groups from the mesh of a sequential MED file.
41  *         Assumes:
42  *         - the file is in MED format and can be read using MED file v2.3.
43  *         - the file is sequential (not a distributed MED).
44  *         - the file only contains TETRA10 elements (dimension of space and mesh is 3).
45  *         - the file have no profil.
46  * \param  medFilename filename of any valid sequential MED file with TETRA10 elements only.
47  * \param  meshName    name of the mesh to be distributed.
48  * \throw  RuntimeException if any error occurs.
49  */
50 void partitionneDomaine(
51         const char* medFilename, 
52         const char* meshName);
53
54
55 /**
56  * \fn     int partitionneGrain(const char* medFilename, const char* groupName, int nbParts, int partitionner)
57  * \brief  creates a distributed MED file (V2.3) by splitting a group of a MED file previously created by partitionneDomaine.
58  *         Assumes:
59  *         - the file is a distributed MED file, previously created by partitionneDomaine()
60  *           (=> each part only contain 1 mesh, TETRA10 elements only)
61  *         - nbPart > 1
62  * \param  medFilename  filename of any valid distributed MED file previously created by partitionneDomaine(). 
63  * \param  partName     name of the part to be splitted.
64  * \param  nbParts      number of parts; must be > 1.
65  * \param  partitionner use value MULTIPR_METIS for Metis or MULTIPR_SCOTCH for Scotch.
66  * \throw  RuntimeException if any error occurs.
67  */
68  void partitionneGrain(
69         const char* medFilename, 
70         const char* partName, 
71         int         nbParts, 
72         int         partitionner=MULTIPR_METIS);
73  
74
75 /**
76  * \fn     int decimePartition(const char* medFilename, const char* partName, const char* fieldName, int fieldIt, const char* filterName, double tmed, double tlow, double radius);
77  * \brief  creates 3 resolutions of the given part of a distributed MED file (V2.3).
78  *         Assumes:
79  *         - the file is a distributed MED file, previously created by partitionneDomaine() or partitionneGrain()
80  *           (=> each part only contain 1 mesh, TETRA10 elements only)
81  * \param  medFilename filename of any valid distributed MED file previously created by partitionneDomaine or partitionneGrain.
82  * \param  partName    name of the part to be decimated.
83  * \param  fieldName   name of the field used for decimation.
84  * \param  fieldIt     iteration (time step) of the field.
85  * \param  filterName  name of the filter to be used.
86  * \param  tmed        threshold used for medium resolution.
87  * \param  tlow        threshold used for low resolution; tmed must be less than tlow
88  * \param  radius      radius used to determine the neighbourhood.
89  * \param  boxing      number of cells along each axis; must be >= 1; e.g. if 100 then acceleration grid will have 100*100*100 = 10**6 cells.
90  * \throw  RuntimeException if any error occurs.
91  */
92 void decimePartition(
93         const char* medFilename,
94         const char* partName,
95         const char* fieldName,
96         int         fieldIt,
97         const char* filterName,
98         double      tmed,
99         double      tlow,
100         double      radius,
101         int         boxing);
102
103 } // namespace MULTIPR
104
105
106 #endif // MULTIPR_API_HXX
107
108 // EOF