1 /*!
2  * \file   mfront/src/ExcelMaterialPropertyInternalInterface.cxx
3  * \brief
4  * \author Thomas Helfer
5  * \date   03 nov. 2014
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 #include"MFront/DSLUtilities.hxx"
15 #include"MFront/ExcelMaterialPropertyInternalInterface.hxx"
16 
17 namespace mfront
18 {
19 
20   std::string
getName()21   ExcelMaterialPropertyInternalInterface::getName()
22   {
23     return "excel-internal";
24   }
25 
26   ExcelMaterialPropertyInternalInterface::ExcelMaterialPropertyInternalInterface() = default;
27 
28   std::string
getGeneratedLibraryName(const MaterialPropertyDescription & mpd) const29   ExcelMaterialPropertyInternalInterface::getGeneratedLibraryName(const MaterialPropertyDescription& mpd) const
30   {
31     return "Excel"+mfront::getMaterialLawLibraryNameBase(mpd);
32   } // end of ExcelMaterialPropertyInternalInterface::getGeneratedLibraryName
33 
34   std::string
getHeaderFileName(const std::string & m,const std::string & c) const35   ExcelMaterialPropertyInternalInterface::getHeaderFileName(const std::string& m,
36 							    const std::string& c) const
37   {
38     return CMaterialPropertyInterface::getHeaderFileName(m,c)+"-Excel";
39   } // end of ExcelMaterialPropertyInternalInterface::getHeaderFileName
40 
41   std::string
getSrcFileName(const std::string & m,const std::string & c) const42   ExcelMaterialPropertyInternalInterface::getSrcFileName(const std::string& m,
43 							 const std::string& c) const
44   {
45     return CMaterialPropertyInterface::getSrcFileName(m,c)+"-Excel";
46   } // end of ExcelMaterialPropertyInternalInterface::getSrcFileName
47 
writeInterfaceSymbol(std::ostream & os,const MaterialPropertyDescription & mpd) const48   void ExcelMaterialPropertyInternalInterface::writeInterfaceSymbol(std::ostream& os,
49 								    const MaterialPropertyDescription& mpd) const{
50     mfront::writeInterfaceSymbol(os,this->getFunctionName(mpd),"Excel");
51   } // end of ExcelMaterialPropertyInternalInterface::writeInterfaceSymbol
52 
writeHeaderPreprocessorDirectives(std::ostream & os,const MaterialPropertyDescription &) const53   void ExcelMaterialPropertyInternalInterface::writeHeaderPreprocessorDirectives(std::ostream& os,
54 										 const MaterialPropertyDescription&) const
55   {
56     os << "#ifndef MFRONT_EXCEL_CALLING_CONVENTION\n"
57        << "#ifdef _WIN32\n"
58        << "#define MFRONT_EXCEL_CALLING_CONVENTION __stdcall\n"
59        << "#else /* _WIN32 */\n"
60        << "#define MFRONT_EXCEL_CALLING_CONVENTION\n"
61        << "#endif /* _WIN32 */\n"
62        << "#endif /* MFRONT_EXCEL_CALLING_CONVENTION */\n";
63   } // end of ExcelMaterialPropertyInternalInterface::writePreprocessorDirectives
64 
65   std::string
getCallingConvention() const66   ExcelMaterialPropertyInternalInterface::getCallingConvention() const{
67     return "MFRONT_EXCEL_CALLING_CONVENTION";
68   }
69 
70   ExcelMaterialPropertyInternalInterface::~ExcelMaterialPropertyInternalInterface() = default;
71 
72 } // end of namespace mfront
73