1 /*!
2  * \file   include/TFEL/System/ExternalLibraryManager.hxx
3  * \brief
4  * \author Thomas Helfer
5  * \date   31 Oct 2007
6  * \copyright Copyright (C) 2006-2018 CEA/DEN, EDF R&D. All rights
7  * reserved.
8  * This project is publicly released under either the GNU GPL Licence
9  * or the CECILL-A licence. A copy of thoses licences are delivered
10  * with the sources of TFEL. CEA or EDF may also distribute this
11  * project under specific licensing conditions.
12  */
13 
14 #ifndef LIB_EXTERNALLIBRARYMANAGER_HXX
15 #define LIB_EXTERNALLIBRARYMANAGER_HXX
16 
17 #include <map>
18 #include <vector>
19 #include <string>
20 
21 #if (defined _WIN32 || defined _WIN64) && (!defined __CYGWIN__)
22 #include <windows.h>
23 #ifdef small
24 #undef small
25 #endif /* small */
26 #endif /* LIB_EXTERNALLIBRARYMANAGER_HXX */
27 
28 #include "TFEL/Config/TFELConfig.hxx"
29 #include "TFEL/Material/OutOfBoundsPolicy.hxx"
30 #include "TFEL/System/ExternalFunctionsPrototypes.hxx"
31 
32 namespace tfel {
33 
34   namespace system {
35 
36     /*!
37      * \brief Structure in charge of loading external function and
38      * retrieving information from shared libraries.
39      */
40     struct TFELSYSTEM_VISIBILITY_EXPORT ExternalLibraryManager {
41       //! \return the uniq instance of this class
42       static ExternalLibraryManager& getExternalLibraryManager();
43     /*!
44      * \brief a wrapper around the ::dlopen system call
45      * \param[in] name : name of the library
46      * \param[in] b : boolean allowing ::dlopen to fail. If ::dlopen
47      * fails, a null pointer is returned. This library is *not*
48      * registred.
49      * \return a pointer to the library
50      * \note on success, the pointer is registred in a map using its
51      * name as a key. This name is used in the methods of this call
52      */
53 #if (defined _WIN32 || defined _WIN64) && (!defined __CYGWIN__)
54       HINSTANCE__* loadLibrary(const std::string&, const bool = false);
55 #else
56       void* loadLibrary(const std::string&, const bool = false);
57 #endif /* LIB_EXTERNALLIBRARYMANAGER_HXX */
58        /*!
59         * \return the path of a library
60         * \param[in] l: library name
61         */
62       std::string getLibraryPath(const std::string&);
63       /*!
64        * \return the list of all mfront generated entry points
65        * in a library.
66        * \param[in] l: library name
67        */
68       std::vector<std::string> getEntryPoints(const std::string&);
69       /*!
70        * \return the material knowledge type of an entry point in a
71        * library. The returned value has the following meaning:
72        * - 0: material property
73        * - 1: behaviour
74        * - 2: model
75        * \param[in] l: library name
exetfel::system::EnumBinaryWriter76        */
77       unsigned short getMaterialKnowledgeType(const std::string&, const std::string&);
78       /*!
79        * \param[in] l : name of the library
80        * \param[in] f : name of function or mechanical behaviour
81        * \param[in] p : out of bounds policy value
82        */
83       void setOutOfBoundsPolicy(const std::string&,
84                                 const std::string&,
85                                 const tfel::material::OutOfBoundsPolicy);
86       /*!
exetfel::system::PointerBinaryWriter87        * \param[in] l : name of the library
88        * \param[in] s : name of function or mechanical behaviour
89        * \param[in] p : parameter name
90        * \param[in] v : value
91        */
92       void setParameter(const std::string&, const std::string&, const std::string&, const double);
93       /*!
94        * set the value of an integer parameter
95        * \param[in] l : name of the library
96        * \param[in] s : name of function or mechanical behaviour
97        * \param[in] p : parameter name
exetfel::system::EmptyBinaryWriter98        * \param[in] v : value
99        */
100       void setParameter(const std::string&, const std::string&, const std::string&, const int);
101       /*!
102        * set the value of an unsigned short parameter
103        * \param[in] l : name of the library
104        * \param[in] s : name of function or mechanical behaviour
105        * \param[in] p : parameter name
106        * \param[in] v : value
exetfel::system::StandardBinaryWriter107        */
108       void setParameter(const std::string&,
109                         const std::string&,
110                         const std::string&,
111                         const unsigned short);
112       /*!
113        * \param[in] l : name of the library
114        * \param[in] s : name of function or mechanical behaviour
115        * \param[in] h : modelling hypothesis
116        * \param[in] p : parameter name
117        * \param[in] v : value
118        */
119       void setParameter(const std::string&,
120                         const std::string&,
121                         const std::string&,
122                         const std::string&,
123                         const double);
124       /*!
125        * set the value of an integer parameter
126        * \param[in] l : name of the library
127        * \param[in] s : name of function or mechanical behaviour
128        * \param[in] h : modelling hypothesis
129         * \param[in] p : parameter name
130        * \param[in] v : value
131        */
132       void setParameter(const std::string&,
133                         const std::string&,
134                         const std::string&,
135                         const std::string&,
exetfel::system::BinaryWriter136                         const int);
137       /*!
138        * set the value of an unsigned short parameter
139        * \param[in] l : name of the library
140        * \param[in] s : name of function or mechanical behaviour
141        * \param[in] h : modelling hypothesis
142        * \param[in] p : parameter name
143        * \param[in] v : value
144        */
145       void setParameter(const std::string&,
146                         const std::string&,
147                         const std::string&,
148                         const std::string&,
binary_write(const int f,const T & v)149                         const unsigned short);
150       /*!
151        * \brief get the default value of a double parameter
152        * \param[in] l : name of the library
153        * \param[in] s : name of function or mechanical behaviour
154        * \param[in] h : modelling hypothesis
155        * \param[in] p : parameter name
156        */
157       double getRealParameterDefaultValue(const std::string&,
158                                           const std::string&,
159                                           const std::string&,
160                                           const std::string&);
161       /*!
162        * \brief get the default value of an integer parameter
163        * \param[in] l : name of the library
164        * \param[in] s : name of function or mechanical behaviour
165        * \param[in] h : modelling hypothesis
166        * \param[in] p : parameter name
167        */
168       int getIntegerParameterDefaultValue(const std::string&,
169                                           const std::string&,
170                                           const std::string&,
171                                           const std::string&);
172       /*!
173        * \brief get the default value of an unsigned short parameter
174        * \param[in] l : name of the library
175        * \param[in] s : name of function or mechanical behaviour
176        * \param[in] h : modelling hypothesis
177        * \param[in] p : parameter name
178        */
179       unsigned short getUnsignedShortParameterDefaultValue(const std::string&,
180                                                            const std::string&,
181                                                            const std::string&,
182                                                            const std::string&);
183       /*!
184        * \return true if the given variable has bounds
185        * \param[in] l: name of the library
186        * \param[in] f: name of function or mechanical behaviour
187        * \param[in] h: modelling hypothesis
188        * \param[in] v: variable name
189        */
190       bool hasBounds(const std::string&,
191                      const std::string&,
192                      const std::string&,
193                      const std::string&);
194       /*!
195        * \return true if the given variable has a lower bound
196        * \param[in] l: name of the library
197        * \param[in] f: name of function or mechanical behaviour
198        * \param[in] h: modelling hypothesis
199        * \param[in] v: variable name
200        */
201       bool hasLowerBound(const std::string&,
202                          const std::string&,
203                          const std::string&,
204                          const std::string&);
205       /*!
206        * \return true if the given variable has a upper bound
207        * \param[in] l: name of the library
208        * \param[in] f: name of function or mechanical behaviour
209        * \param[in] h: modelling hypothesis
210        * \param[in] v: variable name
211        */
212       bool hasUpperBound(const std::string&,
213                          const std::string&,
214                          const std::string&,
215                          const std::string&);
216       /*!
217        * \return the lower bound of the given variable
218        * \param[in] l: name of the library
219        * \param[in] f: name of function or mechanical behaviour
220        * \param[in] h: modelling hypothesis
221        * \param[in] v: variable name
222        */
223       long double getLowerBound(const std::string&,
224                                 const std::string&,
225                                 const std::string&,
226                                 const std::string&);
227       /*!
228        * \return the upper bound of the given variable
229        * \param[in] l: name of the library
230        * \param[in] f: name of function or mechanical behaviour
231        * \param[in] h: modelling hypothesis
232        * \param[in] v: variable name
233        */
234       long double getUpperBound(const std::string&,
235                                 const std::string&,
236                                 const std::string&,
237                                 const std::string&);
238       /*!
239        * \return true if the given variable has bounds
240        * \param[in] l: name of the library
241        * \param[in] f: name of function or mechanical behaviour
242        * \param[in] h: modelling hypothesis
243        * \param[in] v: variable name
244        */
245       bool hasPhysicalBounds(const std::string&,
246                              const std::string&,
247                              const std::string&,
248                              const std::string&);
249       /*!
250        * \return true if the given variable has a lower physical bound
251        * \param[in] l: name of the library
252        * \param[in] f: name of function or mechanical behaviour
253        * \param[in] h: modelling hypothesis
254        * \param[in] v: variable name
255        */
256       bool hasLowerPhysicalBound(const std::string&,
257                                  const std::string&,
258                                  const std::string&,
259                                  const std::string&);
260       /*!
261        * \return true if the given variable has a upper physical bound
262        * \param[in] l: name of the library
263        * \param[in] f: name of function or mechanical behaviour
264        * \param[in] h: modelling hypothesis
265        * \param[in] v: variable name
266        */
267       bool hasUpperPhysicalBound(const std::string&,
268                                  const std::string&,
269                                  const std::string&,
270                                  const std::string&);
271       /*!
272        * \return the lower bound of the given variable
273        * \param[in] l: name of the library
274        * \param[in] f: name of function or mechanical behaviour
275        * \param[in] h: modelling hypothesis
276        * \param[in] v: variable name
277        */
278       long double getLowerPhysicalBound(const std::string&,
279                                         const std::string&,
280                                         const std::string&,
281                                         const std::string&);
282       /*!
283        * \return the upper bound of the given variable
284        * \param[in] l: name of the library
285        * \param[in] f: name of function or mechanical behaviour
286        * \param[in] h: modelling hypothesis
287        * \param[in] v: variable name
288        */
289       long double getUpperPhysicalBound(const std::string&,
290                                         const std::string&,
291                                         const std::string&,
292                                         const std::string&);
293       /*!
294        * \return the TFEL version used to generate the given entry
295        * point.
296        * \param[in] l: name of the library
297        * \param[in] s: name of function or mechanical behaviour
298        * This function looks for the symbol s+'_tfel_version' in the
299        * library and expect it to a pointer to characters.
300        * If the symbol is not found, an empty string is returned.
301        */
302       std::string getTFELVersion(const std::string&, const std::string&);
303       /*!
304        * \return the src of the function or the mechanical behaviour
305        * \param[in] l: name of the library
306        * \param[in] s: name of function or mechanical behaviour
307        * This function looks for the symbol s+'_src' in the library
308        * and expect it to a pointer to characters.
309        * If the symbol is not found, an empty string is returned.
310        */
311       std::string getSource(const std::string&, const std::string&);
312       /*!
313        * \return the interface of the function or the mechanical behaviour
314        * \param[in] l: name of the library
315        * \param[in] s: name of function or mechanical behaviour
316        * This function looks for the symbol s+'_mfront_interface' in the library
317        * and expect it to a pointer to characters.
318        * If the symbol is not found, an empty string is returned.
319        */
320       std::string getInterface(const std::string&, const std::string&);
321       /*!
322        * \return the material associated with the entry point
323        * \param[in] l: name of the library
324        * \param[in] s: name of function or mechanical behaviour
325        * This function looks for the symbol s+'_mfront_material' in the library
326        * and expect it to a pointer to characters.
327        * If the symbol is not found, an empty string is returned.
328        */
329       std::string getMaterial(const std::string&, const std::string&);
330       /*!
331        * \return the list of supported modelling hypotheses
332        * \param[in] l : name of the library
333        * \param[in] s : name of function or mechanical behaviour
334        * This function looks for the symbol s+'_ModellingHypotheses'
335        * in the library and expect it to a pointer to characters. If
336        * the symbol is not found, an empty vector is returned.
337        */
338       std::vector<std::string> getSupportedModellingHypotheses(const std::string&,
339                                                                const std::string&);
340       /*!
341        * \param[in] l : name of the library
342        * \param[in] f : law name
343        */
344       bool contains(const std::string&, const std::string&);
345       /*!
346        * \param[in] l: name of the library
347        * \param[in] f: function name
348        */
349       GenericBehaviourFctPtr getGenericBehaviourFunction(const std::string&, const std::string&);
350       /*!
351        * \param[in] l : name of the library
352        * \param[in] f : law name
353        */
354       CyranoFctPtr getCyranoFunction(const std::string&, const std::string&);
355       /*!
356        * \param[in] l : name of the library
357        * \param[in] f : law name
358        */
359       AsterFctPtr getAsterFunction(const std::string&, const std::string&);
360       /*!
361        * \param[in] l : name of the library
362        * \param[in] f : law name
363        */
364       EuroplexusFctPtr getEuroplexusFunction(const std::string&, const std::string&);
365       /*!
366        * \param[in] l : name of the library
367        * \param[in] f : law name
368        */
369       CastemFctPtr getCastemExternalBehaviourFunction(const std::string&, const std::string&);
370       /*!
371        * \param[in] l : name of the library
372        * \param[in] f : law name
373        */
374       AbaqusFctPtr getAbaqusExternalBehaviourFunction(const std::string&, const std::string&);
375       /*!
376        * \param[in] l : name of the library
377        * \param[in] f : law name
378        */
379       AnsysFctPtr getAnsysExternalBehaviourFunction(const std::string&, const std::string&);
380       /*!
381        * \param[in] l : name of the library
382        * \param[in] f : law name
383        */
384       AbaqusExplicitFctPtr getAbaqusExplicitExternalBehaviourFunction(const std::string&,
385                                                                       const std::string&);
386       /*!
387        * \param[in] l : name of the library
388        * \param[in] f : law name
389        */
390       CalculiXFctPtr getCalculiXExternalBehaviourFunction(const std::string&, const std::string&);
391       /*!
392        * \note the loadLibrary must have already been called with this name
393        */
394       bool isUMATBehaviourUsableInPurelyImplicitResolution(const std::string&,
395                                                            const std::string&,
396                                                            const std::string&);
397       /*!
398        * \return the type of the behaviour
399        * \see MechanicalBehaviourBase::BehaviourType
400        * The value returned has the following meaning:
401        * - 0: general behaviour
402        * - 1: strain based behaviour
403        * - 2: standard finite strain behaviour
404        * - 3: cohesive zone model
405        * \param[in] l : name of the library
406        * \param[in] f : law name
407        */
408       unsigned short getUMATBehaviourType(const std::string&, const std::string&);
409       /*!
410        * \return the kinematic assumption used by the behaviour
411        * \see MechanicalBehaviourBase::Kinematic
412        * The value returned has the following meaning:
413        * - 0: undefined kinematic
414        * - 1: standard small strain behaviour kinematic
415        * - 2: cohesive zone model kinematic
416        * - 3: standard finite strain kinematic (F-Cauchy)
417        * - 4: ptest finite strain kinematic (eto-pk1)
418        * - 5: Green-Lagrange strain
419        * - 6: Miehe Apel Lambrecht logarithmic strain framework
420        * \param[in] l : name of the library
421        * \param[in] f : law name
422        */
423       unsigned short getUMATBehaviourKinematic(const std::string&, const std::string&);
424       /*!
425        * \return the symmetry of the behaviour (isotropic or
426        * orthotropic) If the returned value is 0, the behaviour is
427        * isotropic. If the returned value is 1, the behaviour is
428        * orthotropic.
429        * \param[in] l : name of the library
430        * \param[in] f : law name
431        */
432       unsigned short getUMATSymmetryType(const std::string&, const std::string&);
433       /*!
434        * \return the symmetry of the elastic behaviour (isotropic or
435        * orthotropic) If the returned value is 0, the behaviour is
436        * isotropic. If the returned value is 1, the behaviour is
437        * orthotropic.
438        * \param[in] l : name of the library
439        * \param[in] f : law name
440        */
441       unsigned short getUMATElasticSymmetryType(const std::string&, const std::string&);
442 
443       /*!
444        * \return true if the umat behaviour uses the generic plane stress algorithm
445        * \param[in] l : name of the library
446        * \param[in] f : law name
447        */
448       bool checkIfUMATBehaviourUsesGenericPlaneStressAlgorithm(const std::string&,
449                                                                const std::string&);
450       /*!
451        * \param[in] l : name of the library
452        * \param[in] f : law name
453        */
454       std::vector<std::string> getUMATGradientsNames(const std::string&,
455 						     const std::string&);
456       /*!
457        * \param[in] l : name of the library
458        * \param[in] f : law name
459        */
460       std::vector<int> getUMATGradientsTypes(const std::string&,
461 					     const std::string&);
462       /*!
463        * \param[in] l : name of the library
464        * \param[in] f : law name
465        */
466       std::vector<std::string> getUMATDrivingVariablesNames(const std::string&,
467 							    const std::string&);
468       /*!
469        * \param[in] l : name of the library
470        * \param[in] f : law name
471        */
472       std::vector<int> getUMATDrivingVariablesTypes(const std::string&,
473 						    const std::string&);
474       /*!
475        * \param[in] l : name of the library
476        * \param[in] f : law name
477        */
478       std::vector<std::string> getUMATThermodynamicForcesNames(const std::string&,
479 							       const std::string&);
480       /*!
481        * \param[in] l : name of the library
482        * \param[in] f : law name
483        */
484       std::vector<int> getUMATThermodynamicForcesTypes(const std::string&,
485 						       const std::string&);
486       /*!
487        * \param[in] l : name of the library
488        * \param[in] f : law name
489        * \param[in] h : modelling hypothesis
490        */
491       std::vector<std::string> getUMATMaterialPropertiesNames(const std::string&,
492                                                               const std::string&,
493                                                               const std::string&);
494       /*!
495        * \param[in] l : name of the library
496        * \param[in] f : law name
497        * \param[in] h : modelling hypothesis
498        */
499       std::vector<std::string> getUMATInternalStateVariablesNames(const std::string&,
500                                                                   const std::string&,
501                                                                   const std::string&);
502       /*!
503        * \param[in] l : name of the library
504        * \param[in] f : law name
505        * \param[in] h : modelling hypothesis
506        */
507       std::vector<int> getUMATInternalStateVariablesTypes(const std::string&,
508                                                           const std::string&,
509                                                           const std::string&);
510       /*!
511        * \param[in] l : name of the library
512        * \param[in] f : law name
513        * \param[in] h : modelling hypothesis
514        */
515       std::vector<std::string> getUMATExternalStateVariablesNames(const std::string&,
516                                                                   const std::string&,
517                                                                   const std::string&);
518       /*!
519        * \param[in] l : name of the library
520        * \param[in] f : law name
521        * \param[in] h : modelling hypothesis
522        */
523       std::vector<std::string> getUMATParametersNames(const std::string&,
524                                                       const std::string&,
525                                                       const std::string&);
526       /*!
527        * \return the types associated with each parameter. The integer
528        * values returned have the following meaning:
529        *
530        * - 0: floatting point value
531        * - 1: integer value
532        * - 2: unsigned short value
533        *
534        * \param[in] l : name of the library
535        * \param[in] f : law name
536        * \param[in] h : modelling hypothesis
537        */
538       std::vector<int> getUMATParametersTypes(const std::string&,
539                                               const std::string&,
540                                               const std::string&);
541       /*!
542        * \return true if a behaviour generated throught the aster
543        * interface requires a offset for the elastic properties
544        * \param[in] l : name of the library
545        * \param[in] f : law name
546        * \param[in] h : modelling hypothesis
547        */
548       bool getUMATRequiresStiffnessTensor(const std::string&,
549                                           const std::string&,
550                                           const std::string&);
551       /*!
552        * \return true if a behaviour generated throught the aster
553        * interface requires a offset for the elastic properties
554        * \param[in] l : name of the library
555        * \param[in] f : law name
556        * \param[in] h : modelling hypothesis
557        */
558       bool getUMATRequiresThermalExpansionCoefficientTensor(const std::string&,
559                                                             const std::string&,
560                                                             const std::string&);
561       /*!
562        * \return true if a behaviour generated throught the aster
563        * interface saves the tangent operator
564        * \param[in] l : name of the library
565        * \param[in] f : law name
566        */
567       bool checkIfAsterBehaviourSavesTangentOperator(const std::string&, const std::string&);
568       /*!
569        * \return the aster finite strain formulation.
570        * Possible returned values are:
571        * - 1: `SIMO_MIEHE`
572        * - 2: `GROT_DEP` (total lagrangian)
573        * \param[in] l: name of the library
574        * \param[in] f: law name
575        */
576       unsigned short getAsterFiniteStrainFormulation(const std::string&, const std::string&);
577       /*!
578        * \return the error message if the behaviour did not converge
579        * \param[in] l: name of the library
580        * \param[in] f: law name
581        */
582       AsterIntegrationErrorMessageFctPtr getAsterIntegrationErrorMessageFunction(
583           const std::string&, const std::string&);
584       /*!
585        * \return the orthotropy management policy for the Abaqus and
586        * Abaqus/Explicit interface. See the associated documentation
587        * for details.
588        *
589        * The return value has the following meaning:
590        *
591        * - 0: unspecified policy (equivalent to native)
592        * - 1: native policy (equivalent to native)
593        * - 2: mfront policy
594        *
595        * \param[in] l : name of the library
596        * \param[in] f : law name
597        */
598       unsigned short getAbaqusOrthotropyManagementPolicy(const std::string&, const std::string&);
599       /*!
600        * \param[in] l : name of the library
601        * \param[in] f : function name
602        */
603       unsigned short getCastemFunctionNumberOfVariables(const std::string&, const std::string&);
604 
605       /*!
606        * \param[in] l : name of the library
607        * \param[in] f : function name
608        */
609       std::vector<std::string> getCastemFunctionVariables(const std::string&, const std::string&);
610 
611       /*!
612        * \param[in] l : name of the library
613        * \param[in] f : function name
614        */
615       void getCastemFunctionVariables(std::vector<std::string>&,
616                                       const std::string&,
617                                       const std::string&);
618 
619       /*!
620        * load a function from a library
621        * \param l : library  name
622        * \param f : function name
623        * \return the function pointer
624        */
625       CastemFunctionPtr getCastemFunction(const std::string&, const std::string&);
626 
627       /*!
628        * load a function from a library
629        * \param l : library  name
630        * \param f : function name
631        * \return the function pointer
632        */
633       CFunction0Ptr getCFunction0(const std::string&, const std::string&);
634 
635       /*!
636        * load a function from a library
637        * \param l : library  name
638        * \param f : function name
639        * \return the function pointer
640        */
641       CFunction1Ptr getCFunction1(const std::string&, const std::string&);
642 
643       /*!
644        * load a function from a library
645        * \param l : library  name
646        * \param f : function name
647        * \return the function pointer
648        */
649       CFunction2Ptr getCFunction2(const std::string&, const std::string&);
650 
651       /*!
652        * load a function from a library
653        * \param l : library  name
654        * \param f : function name
655        * \return the function pointer
656        */
657       CFunction3Ptr getCFunction3(const std::string&, const std::string&);
658 
659       /*!
660        * load a function from a library
661        * \param l : library  name
662        * \param f : function name
663        * \return the function pointer
664        */
665       CFunction4Ptr getCFunction4(const std::string&, const std::string&);
666 
667       /*!
668        * load a function from a library
669        * \param l : library  name
670        * \param f : function name
671        * \return the function pointer
672        */
673       CFunction5Ptr getCFunction5(const std::string&, const std::string&);
674 
675       /*!
676        * load a function from a library
677        * \param l : library  name
678        * \param f : function name
679        * \return the function pointer
680        */
681       CFunction6Ptr getCFunction6(const std::string&, const std::string&);
682 
683       /*!
684        * load a function from a library
685        * \param l : library  name
686        * \param f : function name
687        * \return the function pointer
688        */
689       CFunction7Ptr getCFunction7(const std::string&, const std::string&);
690 
691       /*!
692        * load a function from a library
693        * \param l : library  name
694        * \param f : function name
695        * \return the function pointer
696        */
697       CFunction8Ptr getCFunction8(const std::string&, const std::string&);
698 
699       /*!
700        * load a function from a library
701        * \param l : library  name
702        * \param f : function name
703        * \return the function pointer
704        */
705       CFunction9Ptr getCFunction9(const std::string&, const std::string&);
706 
707       /*!
708        * load a function from a library
709        * \param l : library  name
710        * \param f : function name
711        * \return the function pointer
712        */
713       CFunction10Ptr getCFunction10(const std::string&, const std::string&);
714 
715       /*!
716        * load a function from a library
717        * \param l : library  name
718        * \param f : function name
719        * \return the function pointer
720        */
721       CFunction11Ptr getCFunction11(const std::string&, const std::string&);
722 
723       /*!
724        * load a function from a library
725        * \param l : library  name
726        * \param f : function name
727        * \return the function pointer
728        */
729       CFunction12Ptr getCFunction12(const std::string&, const std::string&);
730 
731       /*!
732        * load a function from a library
733        * \param l : library  name
734        * \param f : function name
735        * \return the function pointer
736        */
737       CFunction13Ptr getCFunction13(const std::string&, const std::string&);
738 
739       /*!
740        * load a function from a library
741        * \param l : library  name
742        * \param f : function name
743        * \return the function pointer
744        */
745       CFunction14Ptr getCFunction14(const std::string&, const std::string&);
746 
747       /*!
748        * load a function from a library
749        * \param l : library  name
750        * \param f : function name
751        * \return the function pointer
752        */
753       CFunction15Ptr getCFunction15(const std::string&, const std::string&);
754 
755       /*!
756        * load a function from a library
757        * \param l : library  name
758        * \param f : function name
759        * \return the function pointer
760        */
761       FortranFunction0Ptr getFortranFunction0(const std::string&, const std::string&);
762 
763       /*!
764        * load a function from a library
765        * \param l : library  name
766        * \param f : function name
767        * \return the function pointer
768        */
769       FortranFunction1Ptr getFortranFunction1(const std::string&, const std::string&);
770 
771       /*!
772        * load a function from a library
773        * \param l : library  name
774        * \param f : function name
775        * \return the function pointer
776        */
777       FortranFunction2Ptr getFortranFunction2(const std::string&, const std::string&);
778 
779       /*!
780        * load a function from a library
781        * \param l : library  name
782        * \param f : function name
783        * \return the function pointer
784        */
785       FortranFunction3Ptr getFortranFunction3(const std::string&, const std::string&);
786 
787       /*!
788        * load a function from a library
789        * \param l : library  name
790        * \param f : function name
791        * \return the function pointer
792        */
793       FortranFunction4Ptr getFortranFunction4(const std::string&, const std::string&);
794 
795       /*!
796        * load a function from a library
797        * \param l : library  name
798        * \param f : function name
799        * \return the function pointer
800        */
801       FortranFunction5Ptr getFortranFunction5(const std::string&, const std::string&);
802 
803       /*!
804        * load a function from a library
805        * \param l : library  name
806        * \param f : function name
807        * \return the function pointer
808        */
809       FortranFunction6Ptr getFortranFunction6(const std::string&, const std::string&);
810 
811       /*!
812        * load a function from a library
813        * \param l : library  name
814        * \param f : function name
815        * \return the function pointer
816        */
817       FortranFunction7Ptr getFortranFunction7(const std::string&, const std::string&);
818 
819       /*!
820        * load a function from a library
821        * \param l : library  name
822        * \param f : function name
823        * \return the function pointer
824        */
825       FortranFunction8Ptr getFortranFunction8(const std::string&, const std::string&);
826 
827       /*!
828        * load a function from a library
829        * \param l : library  name
830        * \param f : function name
831        * \return the function pointer
832        */
833       FortranFunction9Ptr getFortranFunction9(const std::string&, const std::string&);
834 
835       /*!
836        * load a function from a library
837        * \param l : library  name
838        * \param f : function name
839        * \return the function pointer
840        */
841       FortranFunction10Ptr getFortranFunction10(const std::string&, const std::string&);
842 
843       /*!
844        * load a function from a library
845        * \param l : library  name
846        * \param f : function name
847        * \return the function pointer
848        */
849       FortranFunction11Ptr getFortranFunction11(const std::string&, const std::string&);
850 
851       /*!
852        * load a function from a library
853        * \param l : library  name
854        * \param f : function name
855        * \return the function pointer
856        */
857       FortranFunction12Ptr getFortranFunction12(const std::string&, const std::string&);
858 
859       /*!
860        * load a function from a library
861        * \param l : library  name
862        * \param f : function name
863        * \return the function pointer
864        */
865       FortranFunction13Ptr getFortranFunction13(const std::string&, const std::string&);
866 
867       /*!
868        * load a function from a library
869        * \param l : library  name
870        * \param f : function name
871        * \return the function pointer
872        */
873       FortranFunction14Ptr getFortranFunction14(const std::string&, const std::string&);
874 
875       /*!
876        * load a function from a library
877        * \param l : library  name
878        * \param f : function name
879        * \return the function pointer
880        */
881       FortranFunction15Ptr getFortranFunction15(const std::string&, const std::string&);
882 
883       ~ExternalLibraryManager();
884 
885      private:
886       TFEL_VISIBILITY_LOCAL ExternalLibraryManager();
887 
888       TFEL_VISIBILITY_LOCAL ExternalLibraryManager(const ExternalLibraryManager&);
889 
890       TFEL_VISIBILITY_LOCAL ExternalLibraryManager& operator=(const ExternalLibraryManager&);
891 
892       TFEL_VISIBILITY_LOCAL void getUMATNames(std::vector<std::string>&,
893                                               const std::string&,
894                                               const std::string&,
895                                               const std::string&,
896                                               const std::string&);
897       TFEL_VISIBILITY_LOCAL void getUMATTypes(std::vector<int>&,
898                                               const std::string&,
899                                               const std::string&,
900                                               const std::string&,
901                                               const std::string&);
902 
903 #if (defined _WIN32 || defined _WIN64) && (!defined __CYGWIN__)
904       std::map<std::string, HINSTANCE__*> librairies;
905 #else
906       std::map<std::string, void*> librairies;
907 #endif /* LIB_EXTERNALLIBRARYMANAGER_HXX */
908 
909     };  // end of struct LibraryManager
910 
911   }  // end of namespace system
912 
913 }  // end of namespace tfel
914 
915 #endif /* LIB_EXTERNALLIBRARYMANAGER_HXX */
916