Salome HOME
Join modifications from BR_Dev_For_4_0 tag V4_1_1.
[modules/med.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 #include <vector>
18 #include <string>
19
20 namespace multipr
21 {
22
23
24 enum Partitionner
25 {
26     MULTIPR_METIS   = 0,
27     MULTIPR_SCOTCH  = 1
28     
29 }; // enum Partitionner
30
31
32 /**
33  * \fn     const char* getVersion()
34  * \brief  returns the current version of the MULTIPR API.
35  * \return the current version of the MULTIPR API. 
36  */
37 const char* getVersion();
38
39
40 /**
41  * \fn     void partitionneDomaine(const char* medFilename, const char* meshName)
42  * \brief  creates a distributed MED file (v2.3) by extracting all the groups from the mesh of a sequential MED file.
43  *         Assumes:
44  *         - the file is in MED format and can be read using MED file v2.3.
45  *         - the file is sequential (not a distributed MED).
46  *         - the file only contains TETRA10 elements (dimension of space and mesh is 3).
47  *         - the file have no profil.
48  * \param  medFilename filename of any valid sequential MED file with TETRA10 elements only.
49  * \param  meshName    name of the mesh to be distributed.
50  * \throw  RuntimeException if any error occurs.
51  */
52 void partitionneDomaine(
53     const char* medFilename, 
54     const char* meshName);
55
56
57 /**
58  * \fn     void partitionneGroupe(const char* medFilename, const char* groupName, int nbParts, int partitionner)
59  * \brief  creates a distributed MED file (V2.3) by splitting a group of a MED file previously created by partitionneDomaine.
60  *         Assumes:
61  *         - the file is a distributed MED file, previously created by partitionneDomaine()
62  *           (=> each part only contain 1 mesh, TETRA10 elements only)
63  *         - nbPart > 1
64  * \param  medFilename  filename of any valid distributed MED file previously created by partitionneDomaine(). 
65  * \param  partName     name of the part to be splitted.
66  * \param  nbParts      number of parts; must be > 1.
67  * \param  partitionner use value MULTIPR_METIS for Metis or MULTIPR_SCOTCH for Scotch.
68  * \throw  RuntimeException if any error occurs.
69  */
70  void partitionneGroupe(
71      const char* medFilename, 
72      const char* partName, 
73      int         nbParts, 
74      int         partitionner=MULTIPR_METIS);
75  
76
77 /**
78  * \fn     void decimePartition(const char* medFilename, const char* partName, const char* fieldName, int fieldIt, const char* filterName, double tmed, double tlow, double radius);
79  * \brief  creates 3 resolutions of the given part of a distributed MED file (V2.3).
80  *         Assumes:
81  *         - the file is a distributed MED file, previously created by partitionneDomaine() or partitionneGroupe()
82  *           (=> each part only contain 1 mesh, TETRA10 elements only)
83  * \param  medFilename filename of any valid distributed MED file previously created by partitionneDomaine or partitionneGroupe.
84  * \param  partName    name of the part to be decimated.
85  * \param  fieldName   name of the field used for decimation.
86  * \param  fieldIt     iteration (time step) of the field.
87  * \param  filterName  name of the filter to be used.
88  * \param  tmed        threshold used for medium resolution.
89  * \param  tlow        threshold used for low resolution; tmed must be less than tlow
90  * \param  radius      radius used to determine the neighbourhood.
91  * \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.
92  * \throw  RuntimeException if any error occurs.
93  */
94 void decimePartition(
95     const char* medFilename,
96     const char* partName,
97     const char* fieldName,
98     int         fieldIt,
99     const char* filterName,
100     const char* filterParams);
101
102     
103 /**
104  * \fn     void merge(...);
105  * \brief  merge a list of sequential MED file if possible.
106  * \param  medFilenameSrc  list of source file (sequential MED files).
107  * \param  meshName        name of the mesh (all mesh must have the same name).
108  * \param  fieldName       name of the field to merge (if NULL, merge all fields).
109  * \param  medFilenameDst  destination file.
110  * \return 1 if a mesh has been generated, 0 otherwise (e.g. if all the sources are empty meshes).
111  * \throw  RuntimeException if any error occurs.
112  */
113 int merge(
114     std::vector<std::string> medFilenameSrc,
115     const char* meshName,
116     const char* fieldName,
117     const char* medFilenameDst);
118
119         
120 } // namespace MULTIPR
121
122
123 #endif // MULTIPR_API_HXX
124
125 // EOF