Skip to content
Snippets Groups Projects
Commit dd28873b authored by Dmitri Naumov's avatar Dmitri Naumov Committed by Dmitri Naumov
Browse files

Add OGS_USE_MFRONT definition.

parent 94f9ebf8
No related branches found
No related tags found
No related merge requests found
......@@ -255,7 +255,9 @@ endif()
option(OGS_USE_MFRONT
"Enable solid material models by MFront (https://tfel.sourceforge.net)"
OFF)
if(OGS_USE_MFRONT)
add_definitions(-DOGS_USE_MFRONT)
endif()
# ---- Definitions ----
if(OGS_USE_LIS)
add_definitions(-DUSE_LIS)
......
......@@ -16,7 +16,9 @@
#include "CreateLinearElasticIsotropic.h"
#include "CreateLinearElasticOrthotropic.h"
#include "CreateLubby2.h"
#ifdef OGS_USE_MFRONT
#include "MFront/CreateMFront.h"
#endif // OGS_USE_MFRONT
#include "MechanicsBase.h"
......@@ -71,8 +73,14 @@ createConstitutiveRelation(
}
if (type == "MFront")
{
#ifdef OGS_USE_MFRONT
return MaterialLib::Solids::MFront::createMFront<DisplacementDim>(
parameters, config);
#else // OGS_USE_MFRONT
OGS_FATAL(
"OGS is compiled without MFront support. See OGS_USE_MFRONT CMake "
"option.");
#endif // OGS_USE_MFRONT
}
OGS_FATAL("Cannot construct constitutive relation of given type '%s'.",
type.c_str());
......
......@@ -9,8 +9,6 @@
#include "CreateMFront.h"
#ifdef OGS_USE_MFRONT
#include "BaseLib/FileTools.h"
#include "ParameterLib/Utils.h"
......@@ -182,28 +180,6 @@ std::unique_ptr<MechanicsBase<DisplacementDim>> createMFront(
} // namespace Solids
} // namespace MaterialLib
#else // OGS_USE_MFRONT
namespace MaterialLib
{
namespace Solids
{
namespace MFront
{
template <int DisplacementDim>
std::unique_ptr<MechanicsBase<DisplacementDim>> createMFront(
std::vector<
std::unique_ptr<ParameterLib::ParameterBase>> const& /*parameters*/,
BaseLib::ConfigTree const& /*config*/)
{
OGS_FATAL("OpenGeoSys has not been build with MFront support.");
}
} // namespace MFront
} // namespace Solids
} // namespace MaterialLib
#endif // OGS_USE_MFRONT
namespace MaterialLib
{
namespace Solids
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment