Attention une mise à jour du service Gitlab va être effectuée le mardi 18 janvier (et non lundi 17 comme annoncé précédemment) entre 18h00 et 18h30. Cette mise à jour va générer une interruption du service dont nous ne maîtrisons pas complètement la durée mais qui ne devrait pas excéder quelques minutes.

Commit 987c119e authored by GILLES Sebastien's avatar GILLES Sebastien
Browse files

#1302 LuaOptionFile: shorten the file by making the selection of a parameter more simple.

Previously, you had to fill each individual type of possibility for a Parameter, regardless of the one finally chosen. For instance, you had something like (skipping the documentation...):

VolumicMass
{
    nature = "constant"
    scalar = 1.
    lua_function = none
    piecewise_constant_domain_id = { }
    piecewise_constant_domain_value = { }
}

and each of these entries should be filled (a shortcut 'none' was however created for lua_function).

This made the Lua files rather heavy, and moreover signaled the non used fields (here VolumicMass.lua_function, VolumicMass.piecewise_constant_domain_id and VolumicMass.piecewise_constant_domain_value) as unused.

Now using up the strength of newly introduced in C++17 std::variant (or boost::variant for Apple Clang currently - see #1305), a more synthetic writing ha been introduced:

VolumicMass
{
    nature = "constant"
    value = 1.
}

where 'value' type depends on the 'nature' choice. For instance, a user might replace it by:

VolumicMass
{
    nature = "piecewise_constant_by_domain"
    value = { [3] = 1., [5] = 0.5 }
}

Please notice the usage of the associative container which was introduced when LuaOptionFile replaced Ops.

NOTE: Rather unusually, I have here merged many commits into one: due to the large scope of the modifications to do, I worked only on a specific test. Consequently, other models and tests stopped to compile, and I really like the code to at least compile at all of its commit not to break the git bisect functionality.
parent 165787d4
......@@ -1134,7 +1134,6 @@
BE8B5FAF2079340700DC005E /* libSeldon.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BEE79A1F1C995B5F00F05519 /* libSeldon.a */; };
BE8B5FB02079340700DC005E /* libUtilities.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BEA8A379177AD4FE009436C9 /* libUtilities.a */; };
BE8B5FB62079341A00DC005E /* libCore.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BE05B52916D238FE000E248D /* libCore.a */; };
BE8B5FB82079345600DC005E /* test_command_line_options.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BE8B5FB72079345600DC005E /* test_command_line_options.cpp */; };
BE8B5FC8207CA05900DC005E /* libCore.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BE05B52916D238FE000E248D /* libCore.a */; };
BE8B5FC9207CA05900DC005E /* libSeldon.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BEE79A1F1C995B5F00F05519 /* libSeldon.a */; };
BE8B5FCA207CA05900DC005E /* libUtilities.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BEA8A379177AD4FE009436C9 /* libUtilities.a */; };
......@@ -1472,6 +1471,9 @@
BE93B31A1F052CFC004F84CF /* Format.hpp in Headers */ = {isa = PBXBuildFile; fileRef = BE93B3191F052CFC004F84CF /* Format.hpp */; };
BE93B3201F0536DA004F84CF /* OutputDeformedMesh.hpp in Headers */ = {isa = PBXBuildFile; fileRef = BE93B31D1F0536DA004F84CF /* OutputDeformedMesh.hpp */; };
BE93B3211F0536DA004F84CF /* OutputDeformedMesh.hxx in Headers */ = {isa = PBXBuildFile; fileRef = BE93B31E1F0536DA004F84CF /* OutputDeformedMesh.hxx */; };
BE9453B52105F24400953B84 /* SpatialLuaFunction.hpp in Headers */ = {isa = PBXBuildFile; fileRef = BE9453B22105F24300953B84 /* SpatialLuaFunction.hpp */; };
BE9453BB2106089F00953B84 /* Variant.hpp in Headers */ = {isa = PBXBuildFile; fileRef = BE9453B82106089F00953B84 /* Variant.hpp */; };
BE9453BD2106098300953B84 /* Variant.hpp in Headers */ = {isa = PBXBuildFile; fileRef = BE9453BC2106098300953B84 /* Variant.hpp */; };
BE9512901A8CC3E5009E0082 /* Mutex.hpp in Headers */ = {isa = PBXBuildFile; fileRef = BE95128D1A8CC3E5009E0082 /* Mutex.hpp */; };
BE9512911A8CC3E5009E0082 /* Mutex.hxx in Headers */ = {isa = PBXBuildFile; fileRef = BE95128E1A8CC3E5009E0082 /* Mutex.hxx */; };
BE964C0E206E54C200B9ED1E /* libCore.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BE05B52916D238FE000E248D /* libCore.a */; };
......@@ -5506,11 +5508,7 @@
BE8B5FA72077D67400DC005E /* CMakeLists.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CMakeLists.txt; sourceTree = "<group>"; };
BE8B5FA82077D68E00DC005E /* CMakeLists.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CMakeLists.txt; sourceTree = "<group>"; };
BE8B5FB52079340700DC005E /* TestMoReFEMData */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = TestMoReFEMData; sourceTree = BUILT_PRODUCTS_DIR; };
BE8B5FB72079345600DC005E /* test_command_line_options.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = test_command_line_options.cpp; sourceTree = "<group>"; };
BE8B5FB920793A4C00DC005E /* demo_morefem_data.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = demo_morefem_data.lua; sourceTree = "<group>"; };
BE8B5FBA20793A6300DC005E /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = "<group>"; };
BE8B5FBB20793C7800DC005E /* CMakeLists.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CMakeLists.txt; sourceTree = "<group>"; };
BE8B5FBC20793D1000DC005E /* CMakeLists.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CMakeLists.txt; sourceTree = "<group>"; };
BE8B5FC0207BC43F00DC005E /* test_results.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = test_results.cpp; sourceTree = "<group>"; };
BE8B5FCF207CA05900DC005E /* TestHeatResult */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = TestHeatResult; sourceTree = BUILT_PRODUCTS_DIR; };
BE8B67311CC0E2E100312399 /* Core.doxygen */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = Core.doxygen; sourceTree = "<group>"; };
......@@ -5675,6 +5673,19 @@
BE93B31E1F0536DA004F84CF /* OutputDeformedMesh.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = OutputDeformedMesh.hxx; sourceTree = "<group>"; };
BE93B3241F053BF3004F84CF /* OutputDeformedMesh.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = OutputDeformedMesh.hpp; sourceTree = "<group>"; };
BE93B3251F053BF3004F84CF /* OutputDeformedMesh.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = OutputDeformedMesh.hxx; sourceTree = "<group>"; };
BE9453992100BCA500953B84 /* CMakeLists.txt */ = {isa = PBXFileReference; lastKnownFileType = text; path = CMakeLists.txt; sourceTree = "<group>"; };
BE94539B2100BCA500953B84 /* CMakeLists.txt */ = {isa = PBXFileReference; lastKnownFileType = text; path = CMakeLists.txt; sourceTree = "<group>"; };
BE94539C2100BCA500953B84 /* demo_morefem_data.lua */ = {isa = PBXFileReference; lastKnownFileType = text; path = demo_morefem_data.lua; sourceTree = "<group>"; };
BE94539D2100BCA500953B84 /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = "<group>"; };
BE94539E2100BCA500953B84 /* test_command_line_options.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = test_command_line_options.cpp; sourceTree = "<group>"; };
BE9453A02100BCA500953B84 /* CMakeLists.txt */ = {isa = PBXFileReference; lastKnownFileType = text; path = CMakeLists.txt; sourceTree = "<group>"; };
BE9453A12100BCA500953B84 /* demo_param.lua */ = {isa = PBXFileReference; lastKnownFileType = text; path = demo_param.lua; sourceTree = "<group>"; };
BE9453A22100BCA500953B84 /* test_parameter.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = test_parameter.cpp; sourceTree = "<group>"; };
BE9453A32100BD5D00953B84 /* InputParameterList.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = InputParameterList.hpp; sourceTree = "<group>"; };
BE9453AF21022D6900953B84 /* CMakeLists.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CMakeLists.txt; sourceTree = "<group>"; };
BE9453B22105F24300953B84 /* SpatialLuaFunction.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = SpatialLuaFunction.hpp; sourceTree = "<group>"; };
BE9453B82106089F00953B84 /* Variant.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = Variant.hpp; sourceTree = "<group>"; };
BE9453BC2106098300953B84 /* Variant.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = Variant.hpp; sourceTree = "<group>"; };
BE95128D1A8CC3E5009E0082 /* Mutex.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = Mutex.hpp; sourceTree = "<group>"; };
BE95128E1A8CC3E5009E0082 /* Mutex.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = Mutex.hxx; sourceTree = "<group>"; };
BE964C1E206E54C200B9ED1E /* TestMassOperator3D */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = TestMassOperator3D; sourceTree = BUILT_PRODUCTS_DIR; };
......@@ -9682,7 +9693,7 @@
isa = PBXGroup;
children = (
BE8B5FBB20793C7800DC005E /* CMakeLists.txt */,
BE8B5FAA207933EF00DC005E /* MoReFEMData */,
BE9453982100BCA500953B84 /* MoReFEMData */,
BE5B8EA21F6DD2FA007816CC /* VariableTimeStep */,
);
path = Core;
......@@ -9691,6 +9702,7 @@
BE5B8EA21F6DD2FA007816CC /* VariableTimeStep */ = {
isa = PBXGroup;
children = (
BE9453AF21022D6900953B84 /* CMakeLists.txt */,
BEF5531A2084C47C00CA8A50 /* test.cpp */,
BE5B8EA31F6DD2FA007816CC /* demo_input_data.lua */,
BE5B8EA41F6DD2FA007816CC /* InputParameterList.hpp */,
......@@ -9843,6 +9855,7 @@
BE5BC2F516C0133300232749 /* Enum.hpp */,
BE42A4391A5D650E00B3FF6B /* InitTimeKeepLog.cpp */,
BE42A4381A5D650E00B3FF6B /* InitTimeKeepLog.hpp */,
BE9453B22105F24300953B84 /* SpatialLuaFunction.hpp */,
BE68B9D11FF385FA009C43BA /* MoReFEMData */,
BE8B67331CC0E9B100312399 /* NumberingSubset */,
BE63C15E1B21DE7900978D05 /* TimeManager */,
......@@ -9877,6 +9890,7 @@
BE901DC01CE31D0B0041C294 /* Miscellaneous.doxygen */,
BE501D031A2DC03900B92486 /* MatrixOrVector.hpp */,
BE5BC3C216C015B800232749 /* Miscellaneous.hpp */,
BE9453B82106089F00953B84 /* Variant.hpp */,
BEA05F5A17E2164B0014DAED /* Exceptions */,
BEB991B318F42080009ACA4C /* Containers */,
BEB991CC18F42080009ACA4C /* String */,
......@@ -10167,7 +10181,7 @@
BE625B391BCBB37200FB316D /* Fiber */,
BE1E87421B8DC7760002EE64 /* MaterialProperty */,
BE7816EE1E82A41D00FF503D /* ViscoelasticBoundaryCondition */,
BEACCC7F1E11D52700CBA4F2 /* Impl */,
BEACCC7F1E11D52700CBA4F2 /* Internal */,
);
name = Parameter;
sourceTree = "<group>";
......@@ -10499,17 +10513,6 @@
path = Environment;
sourceTree = "<group>";
};
BE8B5FAA207933EF00DC005E /* MoReFEMData */ = {
isa = PBXGroup;
children = (
BE8B5FBA20793A6300DC005E /* README.md */,
BE8B5FBC20793D1000DC005E /* CMakeLists.txt */,
BE8B5FB920793A4C00DC005E /* demo_morefem_data.lua */,
BE8B5FB72079345600DC005E /* test_command_line_options.cpp */,
);
path = MoReFEMData;
sourceTree = "<group>";
};
BE8B5FC1207BC6E200DC005E /* ExpectedResults */ = {
isa = PBXGroup;
children = (
......@@ -10913,6 +10916,38 @@
path = OutputDeformedMesh;
sourceTree = "<group>";
};
BE9453982100BCA500953B84 /* MoReFEMData */ = {
isa = PBXGroup;
children = (
BE9453992100BCA500953B84 /* CMakeLists.txt */,
BE94539A2100BCA500953B84 /* CommandLineOptions */,
BE94539F2100BCA500953B84 /* InputParameter */,
);
path = MoReFEMData;
sourceTree = "<group>";
};
BE94539A2100BCA500953B84 /* CommandLineOptions */ = {
isa = PBXGroup;
children = (
BE94539B2100BCA500953B84 /* CMakeLists.txt */,
BE94539C2100BCA500953B84 /* demo_morefem_data.lua */,
BE94539D2100BCA500953B84 /* README.md */,
BE94539E2100BCA500953B84 /* test_command_line_options.cpp */,
);
path = CommandLineOptions;
sourceTree = "<group>";
};
BE94539F2100BCA500953B84 /* InputParameter */ = {
isa = PBXGroup;
children = (
BE9453A02100BCA500953B84 /* CMakeLists.txt */,
BE9453A32100BD5D00953B84 /* InputParameterList.hpp */,
BE9453A12100BCA500953B84 /* demo_param.lua */,
BE9453A22100BCA500953B84 /* test_parameter.cpp */,
);
path = InputParameter;
sourceTree = "<group>";
};
BE9512891A8CC3B8009E0082 /* Mutex */ = {
isa = PBXGroup;
children = (
......@@ -11108,6 +11143,7 @@
isa = PBXGroup;
children = (
BE9ECC0A1F5857B900D92CD7 /* Filesystem.hpp */,
BE9453BC2106098300953B84 /* Variant.hpp */,
);
path = Boost;
sourceTree = "<group>";
......@@ -11420,15 +11456,15 @@
path = Parameter/Fiber/Impl;
sourceTree = "<group>";
};
BEACCC7F1E11D52700CBA4F2 /* Impl */ = {
BEACCC7F1E11D52700CBA4F2 /* Internal */ = {
isa = PBXGroup;
children = (
BEACCC801E11D52700CBA4F2 /* ParameterUsualDescription.cpp */,
BEACCC811E11D52700CBA4F2 /* ParameterUsualDescription.hpp */,
BEACCC821E11D52700CBA4F2 /* ParameterUsualDescription.hxx */,
);
name = Impl;
path = Parameter/Impl;
name = Internal;
path = Parameter/Internal;
sourceTree = "<group>";
};
BEACCC861E11D55B00CBA4F2 /* Impl */ = {
......@@ -12158,8 +12194,8 @@
isa = PBXGroup;
children = (
BEDE16AB204F410E00DEFE08 /* SourceList.cmake */,
BEDE16AC204F410E00DEFE08 /* LuaFunction.hxx */,
BEDE16AD204F410E00DEFE08 /* LuaFunction.hpp */,
BEDE16AC204F410E00DEFE08 /* LuaFunction.hxx */,
);
path = LuaFunction;
sourceTree = "<group>";
......@@ -12735,6 +12771,7 @@
133F22CC1E784C71006A4C8A /* AnalyticalPrestress.hpp in Headers */,
BE625B441BCBB3E800FB316D /* Fiber.hpp in Headers */,
BE40541B1AC1C14D0024D5F9 /* Unknown.hxx in Headers */,
BE9453B52105F24400953B84 /* SpatialLuaFunction.hpp in Headers */,
BE68B9DA1FF385FB009C43BA /* MoReFEMData.hxx in Headers */,
BE42A43B1A5D650E00B3FF6B /* InitTimeKeepLog.hpp in Headers */,
BE607D051B1DE2E6008017B9 /* SpatialFunction.hxx in Headers */,
......@@ -13336,6 +13373,8 @@
BE9EA61B1C89F50900836E0E /* ParameterAtDof.hpp in Headers */,
BE768EC11B836022009B24CB /* Section.hxx in Headers */,
BE90E1601A24926E00CCAFDE /* Miscellaneous.hpp in Headers */,
BE9453BB2106089F00953B84 /* Variant.hpp in Headers */,
BE9453BD2106098300953B84 /* Variant.hpp in Headers */,
BE41A8D01A24AA59004E4312 /* Petsc.hxx in Headers */,
BE2592141C9ABA6900DF404B /* Utilities.doxygen in Headers */,
BE90E1C31A2492AA00CCAFDE /* SubVector.hpp in Headers */,
......@@ -15515,7 +15554,6 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
BE8B5FB82079345600DC005E /* test_command_line_options.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -64,11 +64,11 @@
<CommandLineArguments>
<CommandLineArgument
argument = "--input_parameters ${HOME}/Codes/MoReFEM/CoreLibrary/Sources/ModelInstances/Heat/demo_input_heat_1d.lua"
isEnabled = "YES">
isEnabled = "NO">
</CommandLineArgument>
<CommandLineArgument
argument = "--input_parameters ${HOME}/Codes/MoReFEM/CoreLibrary/Sources/ModelInstances/Heat/demo_input_heat.lua"
isEnabled = "NO">
isEnabled = "YES">
</CommandLineArgument>
</CommandLineArguments>
<AdditionalOptions>
......
......@@ -63,10 +63,21 @@
</BuildableProductRunnable>
<CommandLineArguments>
<CommandLineArgument
argument = "--input_parameters ${HOME}/Codes/MoReFEM/CoreLibrary/Sources/Test/Geometry/LightweightDomainList/demo_input_test_lightweight_domain_list.lua"
argument = "-i ${HOME}/Desktop/Foo.lua"
isEnabled = "YES">
</CommandLineArgument>
<CommandLineArgument
argument = "--input_parameters ${HOME}/Codes/MoReFEM/CoreLibrary/Sources/Test/Geometry/LightweightDomainList/demo_input_test_lightweight_domain_list.lua"
isEnabled = "NO">
</CommandLineArgument>
</CommandLineArguments>
<EnvironmentVariables>
<EnvironmentVariable
key = "MOREFEM_TEST_OUTPUT_DIR"
value = "/tmp/MoReFEM/Test"
isEnabled = "YES">
</EnvironmentVariable>
</EnvironmentVariables>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
......
......@@ -39,7 +39,7 @@ namespace MoReFEM
const std::string& MeshIndex::Description()
{
static std::string ret("Index of the mesh ontpo which current domains are defined.");
static std::string ret("Index of the mesh onto which current domains are defined.");
return ret;
}
......
......@@ -13,7 +13,7 @@
# define MOREFEM_x_CORE_x_INPUT_PARAMETER_x_INITIAL_CONDITION_x_IMPL_x_INITIAL_CONDITION_HPP_
# include "Core/InputParameter/Crtp/Section.hpp"
# include "Core/SpatialLuaFunction.hpp"
# include "Core/InputParameter/Parameter/SpatialFunction.hpp"
......@@ -136,12 +136,13 @@ namespace MoReFEM
/*!
* \brief Function that determines the transient source value. Irrelevant if nature is not lua_function.
*/
struct LuaFunction : public SpatialFunction<CoordsType::global>
struct LuaFunction
: public SpatialFunction<CoordsType::global, spatial_lua_function>
{
//! Convenient alias.
using storage_type = Utilities::InputParameterListNS::LuaFunction<double(double, double, double)>;
using storage_type = spatial_lua_function;
//! Description of the input parameter.
......
......@@ -36,11 +36,6 @@ namespace MoReFEM
}
const std::string& AnalyticalPrestress::Contractility::Scalar::Constraint()
{
return Utilities::EmptyString();
}
const std::string& AnalyticalPrestress::InitialCondition::GetName()
{
static std::string ret("InitialCondition");
......
......@@ -13,7 +13,7 @@
# define MOREFEM_x_CORE_x_INPUT_PARAMETER_x_PARAMETER_x_ANALYTICAL_PRESTRESS_x_ANALYTICAL_PRESTRESS_HPP_
# include "Core/InputParameter/Crtp/Section.hpp"
# include "Core/InputParameter/Parameter/Impl/ParameterUsualDescription.hpp"
# include "Core/InputParameter/Parameter/Internal/ParameterUsualDescription.hpp"
namespace MoReFEM
......@@ -67,60 +67,15 @@ namespace MoReFEM
/*!
* \brief Choose how is described the parameter (through a scalar, a function, etc...)
*/
struct Nature : public Crtp::InputParameter<Nature, self, Impl::Nature::storage_type>,
public Impl::Nature
struct Nature : public Crtp::InputParameter<Nature, self, typename Internal::InputParameter::Nature<>::storage_type>,
public Internal::InputParameter::Nature<>
{ };
/*!
* \brief Scalar value. Irrelevant if nature is not scalar.
*/
struct Scalar : public Crtp::InputParameter<Scalar, self, Impl::Scalar::storage_type>,
public Impl::Scalar
{
/*!
* \return Constraint to fulfill.
*
* Might be left empty; if not the format to respect is the \a LuaOptionFile one. Hereafter some text from \a LuaOptionFile example file:
*
* An age should be greater than 0 and less than, say, 150. It is possible
* to check it with a logical expression (written in Lua). The expression
* should be written with 'v' being the variable to be checked.
* \a constraint = "v >= 0 and v < 150"
*
* It is possible to check whether a variable is in a set of acceptable
* value. This is performed with 'value_in' (a Lua function defined by \a LuaOptionFile).
* \a constraint = "value_in(v, {'Messiah', 'Water Music'})"
*
* If a vector is retrieved, the constraint must be satisfied on every
* element of the vector.
*/
static const std::string& Constraint();
};
/*!
* \brief Function that determines diffusion tensor value. Irrelevant if nature is not lua_function.
*/
struct LuaFunction : public Crtp::InputParameter<LuaFunction, self, Impl::LuaFunction::storage_type>,
public Impl::LuaFunction
{ };
/*!
* \brief Piecewise Constant domain index.
*/
struct PiecewiseConstantByDomainId : public Crtp::InputParameter<PiecewiseConstantByDomainId, self, Impl::PiecewiseConstantByDomainId::storage_type>,
public Impl::PiecewiseConstantByDomainId
{ };
/*!
* \brief Piecewise Constant value by domain.
*/
struct PiecewiseConstantByDomainValue : public Crtp::InputParameter<PiecewiseConstantByDomainValue, self, Impl::PiecewiseConstantByDomainValue::storage_type>,
public Impl::PiecewiseConstantByDomainValue
//! \copydoc doxygen_hide_param_value_struct
struct Value
: public Crtp::InputParameter<Value, self, Internal::InputParameter::Value<Nature>::storage_type>,
public Internal::InputParameter::Value<Nature>
{ };
......@@ -129,10 +84,7 @@ namespace MoReFEM
using section_content_type = std::tuple
<
Nature,
Scalar,
LuaFunction,
PiecewiseConstantByDomainId,
PiecewiseConstantByDomainValue
Value
>;
......
......@@ -17,7 +17,7 @@
# include "Core/InputParameter/Crtp/Section.hpp"
# include "Core/InputParameter/Parameter/SpatialFunction.hpp"
# include "Core/InputParameter/Parameter/Impl/ParameterUsualDescription.hpp"
# include "Core/InputParameter/Parameter/Internal/ParameterUsualDescription.hpp"
namespace MoReFEM
......@@ -75,73 +75,23 @@ namespace MoReFEM
/*!
* \brief Choose how is described the diffusion tensor (through a scalar, a function, etc...)
*/
struct Nature : public Crtp::InputParameter<Nature, self, Impl::Nature::storage_type>,
public Impl::Nature
struct Nature : public Crtp::InputParameter<Nature, self, typename Internal::InputParameter::Nature<>::storage_type>,
public Internal::InputParameter::Nature<>
{ };
/*!
* \brief Scalar value. Irrelevant if nature is not scalar.
*/
struct Scalar : public Crtp::InputParameter<Scalar, self, Impl::Scalar::storage_type>,
public Impl::Scalar
{
/*!
* \return Constraint to fulfill.
*
* Might be left empty; if not the format to respect is the \a LuaOptionFile one. Hereafter some text from \a LuaOptionFile example file:
*
* An age should be greater than 0 and less than, say, 150. It is possible
* to check it with a logical expression (written in Lua). The expression
* should be written with 'v' being the variable to be checked.
* \a constraint = "v >= 0 and v < 150"
*
* It is possible to check whether a variable is in a set of acceptable
* value. This is performed with 'value_in' (a Lua function defined by \a LuaOptionFile).
* \a constraint = "value_in(v, {'Messiah', 'Water Music'})"
*
* If a vector is retrieved, the constraint must be satisfied on every
* element of the vector.
*/
static const std::string& Constraint();
};
/*!
* \brief Function that determines diffusion tensor value. Irrelevant if nature is not lua_function.
*/
struct LuaFunction : public Crtp::InputParameter<LuaFunction, self, Impl::LuaFunction::storage_type>,
public Impl::LuaFunction
//! \copydoc doxygen_hide_param_value_struct
struct Value
: public Crtp::InputParameter<Value, self, typename Internal::InputParameter::Value<Nature>::storage_type>,
public Internal::InputParameter::Value<Nature>
{ };
/*!
* \brief Piecewise Constant domain index.
*/
struct PiecewiseConstantByDomainId : public Crtp::InputParameter<PiecewiseConstantByDomainId, self, Impl::PiecewiseConstantByDomainId::storage_type>,
public Impl::PiecewiseConstantByDomainId
{ };
/*!
* \brief Piecewise Constant value by domain.
*/
struct PiecewiseConstantByDomainValue : public Crtp::InputParameter<PiecewiseConstantByDomainValue, self, Impl::PiecewiseConstantByDomainValue::storage_type>,
public Impl::PiecewiseConstantByDomainValue
{ };
//! Alias to the tuple of structs.
using section_content_type = std::tuple
<
Nature,
Scalar,
LuaFunction,
PiecewiseConstantByDomainId,
PiecewiseConstantByDomainValue
Value
>;
......@@ -180,53 +130,23 @@ namespace MoReFEM
/*!
* \brief Choose how is described the diffusion density (through a scalar, a function, etc...)
*/
struct Nature : public Crtp::InputParameter<Nature, Density, Impl::Nature::storage_type>,
public Impl::Nature
{ };
/*!
* \brief Scalar value. Irrelevant if nature is not scalar.
*/
struct Scalar : public Crtp::InputParameter<Scalar, Density, Impl::Scalar::storage_type>,
public Impl::Scalar
struct Nature : public Crtp::InputParameter<Nature, Density, typename Internal::InputParameter::Nature<>::storage_type>,
public Internal::InputParameter::Nature<>
{ };
/*!
* \brief Function that determines diffusion density value. Irrelevant if nature is not lua_function.
*/
struct LuaFunction : public Crtp::InputParameter<LuaFunction, Density, Impl::LuaFunction::storage_type>,
public Impl::LuaFunction
//! \copydoc doxygen_hide_param_value_struct
struct Value
: public Crtp::InputParameter<Value, self, Internal::InputParameter::Value<Nature>::storage_type>,
public Internal::InputParameter::Value<Nature>
{ };
/*!
* \brief Piecewise Constant domain index.
*/
struct PiecewiseConstantByDomainId : public Crtp::InputParameter<PiecewiseConstantByDomainId, Density, Impl::PiecewiseConstantByDomainId::storage_type>,
public Impl::PiecewiseConstantByDomainId
{ };
/*!
* \brief Piecewise Constant value by domain.
*/
struct PiecewiseConstantByDomainValue : public Crtp::InputParameter<PiecewiseConstantByDomainValue, Density, Impl::PiecewiseConstantByDomainValue::storage_type>,
public Impl::PiecewiseConstantByDomainValue
{ };
//! Alias to the tuple of structs.
using section_content_type = std::tuple
<
Nature,
Scalar,
LuaFunction,
PiecewiseConstantByDomainId,
PiecewiseConstantByDomainValue
Value
>;
......@@ -265,41 +185,16 @@ namespace MoReFEM
/*!
* \brief Choose how is described the transfert coefficient (through a scalar, a function, etc...)
*/
struct Nature : public Crtp::InputParameter<Nature, TransfertCoefficient, Impl::Nature::storage_type>,
public Impl::Nature
{ };
/*!
* \brief Scalar value. Irrelevant if nature is not scalar.
*/
struct Scalar : public Crtp::InputParameter<Scalar, TransfertCoefficient, Impl::Scalar::storage_type>,
public Impl::Scalar
{ };
/*!
* \brief Function that determines transfert coefficient value. Irrelevant if nature is not lua_function.
*/
struct LuaFunction : public Crtp::InputParameter<LuaFunction, TransfertCoefficient, Impl::LuaFunction::storage_type>,
public Impl::LuaFunction
struct Nature
: public Crtp::InputParameter<Nature, TransfertCoefficient, typename Internal::InputParameter::Nature<>::storage_type>,
public Internal::InputParameter::Nature<>
{ };
/*!
* \brief Piecewise Constant domain index.
*/
struct PiecewiseConstantByDomainId : public Crtp::InputParameter<PiecewiseConstantByDomainId, TransfertCoefficient, Impl::PiecewiseConstantByDomainId::storage_type>,
public Impl::PiecewiseConstantByDomainId
{ };
/*!
* \brief Piecewise Constant value by domain.
*/
struct PiecewiseConstantByDomainValue : public Crtp::InputParameter<PiecewiseConstantByDomainValue, TransfertCoefficient, Impl::PiecewiseConstantByDomainValue::storage_type>,
public Impl::PiecewiseConstantByDomainValue
//! \copydoc doxygen_hide_param_value_struct
struct Value
: public Crtp::InputParameter<Value, self, Internal::InputParameter::Value<Nature>::storage_type>,
public Internal::InputParameter::Value<Nature>
{ };
......@@ -307,10 +202,7 @@ namespace MoReFEM
using section_content_type = std::tuple
<
Nature,
Scalar,
LuaFunction,
PiecewiseConstantByDomainId,
PiecewiseConstantByDomainValue
Value
>;
......
......@@ -12,6 +12,7 @@
#ifndef MOREFEM_x_CORE_x_INPUT_PARAMETER_x_PARAMETER_x_DIFFUSION_x_DIFFUSION_HXX_
# define MOREFEM_x_CORE_x_INPUT_PARAMETER_x_PARAMETER_x_DIFFUSION_x_DIFFUSION_HXX_
namespace MoReFEM
{
......@@ -28,13 +29,6 @@ namespace MoReFEM
}