Attention une mise à jour du service Gitlab va être effectuée le mardi 30 novembre entre 17h30 et 18h00. 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. Cette mise à jour intermédiaire en version 14.0.12 nous permettra de rapidement pouvoir mettre à votre disposition une version plus récente.

Commit 75edc91e authored by GILLES Sebastien's avatar GILLES Sebastien
Browse files

#1443 In fact, the new template parameter in MoReFEMData wasn't necessary:...

#1443 In fact, the new template parameter in MoReFEMData wasn't necessary: there was already a constexpr method that gave the right answer.
parent b2a6eaca
......@@ -44,14 +44,7 @@ namespace MoReFEM
/// \addtogroup CoreGroup
///@{
//! Whether there is a Parallelism block in MoReFEM input data.
enum class is_parallelism_field
{
no, yes
};
/*!
* \brief Init MoReFEM: initialize mpi and read the input data file.
*
......@@ -65,7 +58,6 @@ namespace MoReFEM
* \tparam AdditionalCommandLineArgumentsPolicyT Policy if you need additional arguments on the command line.
* To see a concrete example of this possibility, have a look at Test/Core/MoReFEMData/test_command_line_options.cpp
* which demonstrate the possibility. If none, use std::false_type.
* \tparam IsParallelismFieldT Whether there is a Parallelism block in MoReFEM input data.
*
* http://tclap.sourceforge.net gives a nice manual of how to add additional argument on the command lines.
* By default, there is one mandatory argument (--input_data *lua file*) and one optional that might be
......@@ -75,7 +67,6 @@ namespace MoReFEM
<
class InputDataT,
program_type ProgramTypeT,
is_parallelism_field IsParallelismFieldT = is_parallelism_field::no,
Utilities::InputDataNS::DoTrackUnusedFields DoTrackUnusedFieldsT = Utilities::InputDataNS::DoTrackUnusedFields::yes,
class AdditionalCommandLineArgumentsPolicyT = std::false_type
>
......@@ -89,7 +80,6 @@ namespace MoReFEM
<
InputDataT,
ProgramTypeT,
IsParallelismFieldT,
DoTrackUnusedFieldsT,
AdditionalCommandLineArgumentsPolicyT
>;
......@@ -148,10 +138,6 @@ namespace MoReFEM
//! \return True if there is one.
static constexpr bool IsParallelismField();
//! Whether there is a Parallelism block in MoReFEM input data.
//! \return The value of the dedicated enum class.
static constexpr is_parallelism_field IsParallelismFieldEnumClass();
private:
//! Accessor to the object which keeps the data related to parallelism strategy.
......
......@@ -24,43 +24,25 @@ namespace MoReFEM
<
class InputDataT,
program_type ProgramTypeT,
is_parallelism_field IsParallelismFieldT,
Utilities::InputDataNS::DoTrackUnusedFields DoTrackUnusedFieldsT,
class AdditionalCommandLineArgumentsPolicyT
>
constexpr bool
MoReFEMData<InputDataT, ProgramTypeT, IsParallelismFieldT, DoTrackUnusedFieldsT, AdditionalCommandLineArgumentsPolicyT>
MoReFEMData<InputDataT, ProgramTypeT, DoTrackUnusedFieldsT, AdditionalCommandLineArgumentsPolicyT>
::IsParallelismField()
{
return IsParallelismFieldT == is_parallelism_field::yes;
return InputDataT::template Find<InputDataNS::Parallelism>();
}
template
<
class InputDataT,
program_type ProgramTypeT,
is_parallelism_field IsParallelismFieldT,
Utilities::InputDataNS::DoTrackUnusedFields DoTrackUnusedFieldsT,
class AdditionalCommandLineArgumentsPolicyT
>
constexpr is_parallelism_field
MoReFEMData<InputDataT, ProgramTypeT, IsParallelismFieldT, DoTrackUnusedFieldsT, AdditionalCommandLineArgumentsPolicyT>
::IsParallelismFieldEnumClass()
{
return IsParallelismFieldT;
}
template
<
class InputDataT,
program_type ProgramTypeT,
is_parallelism_field IsParallelismFieldT,
Utilities::InputDataNS::DoTrackUnusedFields DoTrackUnusedFieldsT,
class AdditionalCommandLineArgumentsPolicyT
>
MoReFEMData<InputDataT, ProgramTypeT, IsParallelismFieldT, DoTrackUnusedFieldsT, AdditionalCommandLineArgumentsPolicyT>
MoReFEMData<InputDataT, ProgramTypeT, DoTrackUnusedFieldsT, AdditionalCommandLineArgumentsPolicyT>
::MoReFEMData(int argc, char** argv)
{
Internal::PetscNS::RAII::CreateOrGetInstance(__FILE__, __LINE__, argc, argv);
......@@ -158,11 +140,10 @@ namespace MoReFEM
<
class InputDataT,
program_type ProgramTypeT,
is_parallelism_field IsParallelismFieldT,
Utilities::InputDataNS::DoTrackUnusedFields DoTrackUnusedFieldsT,
class AdditionalCommandLineArgumentsPolicyT
>
MoReFEMData<InputDataT, ProgramTypeT, IsParallelismFieldT, DoTrackUnusedFieldsT, AdditionalCommandLineArgumentsPolicyT>
MoReFEMData<InputDataT, ProgramTypeT, DoTrackUnusedFieldsT, AdditionalCommandLineArgumentsPolicyT>
::~MoReFEMData()
{
......@@ -194,12 +175,11 @@ namespace MoReFEM
<
class InputDataT,
program_type ProgramTypeT,
is_parallelism_field IsParallelismFieldT,
Utilities::InputDataNS::DoTrackUnusedFields DoTrackUnusedFieldsT,
class AdditionalCommandLineArgumentsPolicyT
>
inline const Wrappers::Mpi&
MoReFEMData<InputDataT, ProgramTypeT, IsParallelismFieldT, DoTrackUnusedFieldsT, AdditionalCommandLineArgumentsPolicyT>
MoReFEMData<InputDataT, ProgramTypeT, DoTrackUnusedFieldsT, AdditionalCommandLineArgumentsPolicyT>
::GetMpi() const noexcept
{
decltype(auto) raii = Internal::PetscNS::RAII::GetInstance(__FILE__, __LINE__);
......@@ -211,12 +191,11 @@ namespace MoReFEM
<
class InputDataT,
program_type ProgramTypeT,
is_parallelism_field IsParallelismFieldT,
Utilities::InputDataNS::DoTrackUnusedFields DoTrackUnusedFieldsT,
class AdditionalCommandLineArgumentsPolicyT
>
const InputDataT&
MoReFEMData<InputDataT, ProgramTypeT, IsParallelismFieldT, DoTrackUnusedFieldsT, AdditionalCommandLineArgumentsPolicyT>
MoReFEMData<InputDataT, ProgramTypeT, DoTrackUnusedFieldsT, AdditionalCommandLineArgumentsPolicyT>
::GetInputData() const noexcept
{
assert(!(!input_data_));
......@@ -228,12 +207,11 @@ namespace MoReFEM
<
class InputDataT,
program_type ProgramTypeT,
is_parallelism_field IsParallelismFieldT,
Utilities::InputDataNS::DoTrackUnusedFields DoTrackUnusedFieldsT,
class AdditionalCommandLineArgumentsPolicyT
>
const FilesystemNS::Directory&
MoReFEMData<InputDataT, ProgramTypeT, IsParallelismFieldT, DoTrackUnusedFieldsT, AdditionalCommandLineArgumentsPolicyT>
MoReFEMData<InputDataT, ProgramTypeT, DoTrackUnusedFieldsT, AdditionalCommandLineArgumentsPolicyT>
::GetResultDirectory() const noexcept
{
assert(!(!result_directory_));
......@@ -245,12 +223,11 @@ namespace MoReFEM
<
class InputDataT,
program_type ProgramTypeT,
is_parallelism_field IsParallelismFieldT,
Utilities::InputDataNS::DoTrackUnusedFields DoTrackUnusedFieldsT,
class AdditionalCommandLineArgumentsPolicyT
>
const Internal::Parallelism*
MoReFEMData<InputDataT, ProgramTypeT, IsParallelismFieldT, DoTrackUnusedFieldsT, AdditionalCommandLineArgumentsPolicyT>
MoReFEMData<InputDataT, ProgramTypeT, DoTrackUnusedFieldsT, AdditionalCommandLineArgumentsPolicyT>
::GetParallelismPtr() const noexcept
{
if (!parallelism_)
......@@ -264,12 +241,11 @@ namespace MoReFEM
<
class InputDataT,
program_type ProgramTypeT,
is_parallelism_field IsParallelismFieldT,
Utilities::InputDataNS::DoTrackUnusedFields DoTrackUnusedFieldsT,
class AdditionalCommandLineArgumentsPolicyT
>
const Internal::Parallelism&
MoReFEMData<InputDataT, ProgramTypeT, IsParallelismFieldT, DoTrackUnusedFieldsT, AdditionalCommandLineArgumentsPolicyT>
MoReFEMData<InputDataT, ProgramTypeT, DoTrackUnusedFieldsT, AdditionalCommandLineArgumentsPolicyT>
::GetParallelism() const noexcept
{
assert(!(!parallelism_));
......
......@@ -40,7 +40,6 @@ int main(int argc, char** argv)
<
InputData,
program_type::post_processing,
is_parallelism_field::no,
Utilities::InputDataNS::DoTrackUnusedFields::no
> morefem_data(argc, argv);
......
......@@ -40,7 +40,6 @@ int main(int argc, char** argv)
<
InputData,
program_type::post_processing,
is_parallelism_field::no,
Utilities::InputDataNS::DoTrackUnusedFields::no
> morefem_data(argc, argv);
......
......@@ -132,7 +132,7 @@ namespace MoReFEM
using InputData = InputData<InputDataTuple>;
//! \copydoc doxygen_hide_morefem_data_type
using morefem_data_type = MoReFEMData<InputData, program_type::model, is_parallelism_field::yes>;
using morefem_data_type = MoReFEMData<InputData, program_type::model>;
} // namespace CardiacMechanicsPrestressNS
......
......@@ -32,7 +32,7 @@ int main(int argc, char** argv)
try
{
MoReFEMData<InputData, program_type::model, is_parallelism_field::yes> morefem_data(argc, argv);
MoReFEMData<InputData, program_type::model> morefem_data(argc, argv);
const auto& input_data = morefem_data.GetInputData();
const auto& mpi = morefem_data.GetMpi();
......
......@@ -40,7 +40,6 @@ int main(int argc, char** argv)
<
InputData,
program_type::post_processing,
is_parallelism_field::no,
Utilities::InputDataNS::DoTrackUnusedFields::no
> morefem_data(argc, argv);
......
......@@ -40,7 +40,6 @@ int main(int argc, char** argv)
<
InputData,
program_type::post_processing,
is_parallelism_field::no,
Utilities::InputDataNS::DoTrackUnusedFields::no
> morefem_data(argc, argv);
......
......@@ -40,7 +40,6 @@ int main(int argc, char** argv)
<
InputData,
program_type::post_processing,
is_parallelism_field::no,
Utilities::InputDataNS::DoTrackUnusedFields::no
> morefem_data(argc, argv);
......
......@@ -41,7 +41,6 @@ int main(int argc, char** argv)
<
InputData,
program_type::post_processing,
is_parallelism_field::no,
Utilities::InputDataNS::DoTrackUnusedFields::no
> morefem_data(argc, argv);
......
......@@ -55,7 +55,6 @@ int main(int argc, char** argv)
<
InputData,
program_type::post_processing,
is_parallelism_field::no,
Utilities::InputDataNS::DoTrackUnusedFields::no
> morefem_data(argc, argv);
......
......@@ -72,7 +72,6 @@ int main(int argc, char** argv)
<
InputData,
program_type::post_processing,
is_parallelism_field::no,
Utilities::InputDataNS::DoTrackUnusedFields::no
>;
......
......@@ -73,7 +73,6 @@ BOOST_FIXTURE_TEST_CASE(cli_options, Fixture)
<
InputData,
program_type::test,
is_parallelism_field::no,
Utilities::InputDataNS::DoTrackUnusedFields::no,
NewArguments
>;
......
......@@ -112,7 +112,7 @@ namespace MoReFEM
using InputData = InputData<InputDataTuple>;
//! \copydoc doxygen_hide_morefem_data_type
using morefem_data_type = MoReFEMData<InputData, program_type::test, is_parallelism_field::yes>;
using morefem_data_type = MoReFEMData<InputData, program_type::test>;
} // namespace LoadPrepartitionedGodOfDofNS
......
......@@ -70,7 +70,7 @@ namespace MoReFEM
using InputData = InputData<InputDataTuple>;
//! \copydoc doxygen_hide_morefem_data_type
using morefem_data_type = MoReFEMData<InputData, program_type::test, is_parallelism_field::yes>;
using morefem_data_type = MoReFEMData<InputData, program_type::test>;
} // namespace LoadPrepartitionedMeshNS
......
......@@ -39,7 +39,6 @@ int main(int argc, char** argv)
<
InputData,
program_type::post_processing,
is_parallelism_field::no,
Utilities::InputDataNS::DoTrackUnusedFields::no
> morefem_data(argc, argv);
......
......@@ -39,7 +39,6 @@ int main(int argc, char** argv)
<
InputData,
program_type::post_processing,
is_parallelism_field::no,
Utilities::InputDataNS::DoTrackUnusedFields::no
> morefem_data(argc, argv);
......
......@@ -90,7 +90,7 @@ namespace MoReFEM
using input_data_type = typename morefem_data_type::input_data_type;
//! Alias to the proper InitializeTestMoReFEMData type.
using initialize_type = TestNS::InitializeTestMoReFEMData<input_data_type, morefem_data_type::IsParallelismFieldEnumClass()>;
using initialize_type = TestNS::InitializeTestMoReFEMData<input_data_type>;
/*!
* \brief Static method which yields the model considered for the tests.
......
......@@ -34,17 +34,17 @@ namespace MoReFEM
* so the Lua file is given as is in the main program. Under the hood we have to mimic the argument argv
* we would have obtained from the command line; it is the point of current class.
*/
template<class InputDataT, is_parallelism_field IsParallelismFieldT = is_parallelism_field::no>
template<class InputDataT>
class InitializeTestMoReFEMData
{
public:
//! \copydoc doxygen_hide_alias_self
using self = InitializeTestMoReFEMData<InputDataT, IsParallelismFieldT>;
using self = InitializeTestMoReFEMData<InputDataT>;
//! Alias to the type of \a MoReFEMData.
using morefem_data_type = MoReFEMData<InputDataT, program_type::test, IsParallelismFieldT>;
using morefem_data_type = MoReFEMData<InputDataT, program_type::test>;
//! Alias to unique pointer.
using const_unique_ptr = std::unique_ptr<const self>;
......
......@@ -20,9 +20,9 @@ namespace MoReFEM
{
template<class InputDataT, is_parallelism_field IsParallelismFieldT>
template<class InputDataT>
template<class T>
InitializeTestMoReFEMData<InputDataT, IsParallelismFieldT>
InitializeTestMoReFEMData<InputDataT>
::InitializeTestMoReFEMData(T&& lua_file)
{
decltype(auto) environment = Utilities::Environment::CreateOrGetInstance(__FILE__, __LINE__);
......@@ -40,9 +40,9 @@ namespace MoReFEM
}
template<class InputDataT, is_parallelism_field IsParallelismFieldT>
const typename InitializeTestMoReFEMData<InputDataT, IsParallelismFieldT>::morefem_data_type&
InitializeTestMoReFEMData<InputDataT, IsParallelismFieldT>::GetMoReFEMData() const noexcept
template<class InputDataT>
const typename InitializeTestMoReFEMData<InputDataT>::morefem_data_type&
InitializeTestMoReFEMData<InputDataT>::GetMoReFEMData() const noexcept
{
assert(!(!morefem_data_));
return *morefem_data_;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment