Commit 5f61b909 authored by GILLES Sebastien's avatar GILLES Sebastien

#1480 Solving compilation and documentation warnings from CI.

parent c32796b4
......@@ -1633,8 +1633,8 @@
BEF4A6E122E1BF0400CD4A6E /* OutputDirectoryStorage.hxx in Headers */ = {isa = PBXBuildFile; fileRef = BEF4A6DE22E1BF0400CD4A6E /* OutputDirectoryStorage.hxx */; };
BEF4A6E222E1BF0400CD4A6E /* OutputDirectoryStorage.hpp in Headers */ = {isa = PBXBuildFile; fileRef = BEF4A6DF22E1BF0400CD4A6E /* OutputDirectoryStorage.hpp */; };
BEF795E022DDDE430054B192 /* BinaryOrAscii.hpp in Headers */ = {isa = PBXBuildFile; fileRef = BEF795DD22DDDE430054B192 /* BinaryOrAscii.hpp */; };
BEF9B60F231E590D009A680D /* Directory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BEF9B60D231E590C009A680D /* Directory.cpp */; };
BEF9B612231E591B009A680D /* Directory.hpp in Headers */ = {isa = PBXBuildFile; fileRef = BEF9B611231E591B009A680D /* Directory.hpp */; };
BEF9B614231EA647009A680D /* GetRankDirectory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BEF9B613231EA647009A680D /* GetRankDirectory.cpp */; };
BEF9B616231EA652009A680D /* GetRankDirectory.hpp in Headers */ = {isa = PBXBuildFile; fileRef = BEF9B615231EA652009A680D /* GetRankDirectory.hpp */; };
BEFC32DF1CB53C3B00C8903C /* RefFEltInLocalOperator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BEFC32DC1CB53C3B00C8903C /* RefFEltInLocalOperator.cpp */; };
BEFC32E01CB53C3B00C8903C /* RefFEltInLocalOperator.hpp in Headers */ = {isa = PBXBuildFile; fileRef = BEFC32DD1CB53C3B00C8903C /* RefFEltInLocalOperator.hpp */; };
BEFC32E11CB53C3B00C8903C /* RefFEltInLocalOperator.hxx in Headers */ = {isa = PBXBuildFile; fileRef = BEFC32DE1CB53C3B00C8903C /* RefFEltInLocalOperator.hxx */; };
......@@ -4899,8 +4899,8 @@
BEF795DD22DDDE430054B192 /* BinaryOrAscii.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = BinaryOrAscii.hpp; sourceTree = "<group>"; };
BEF9835B180451CF00E7905D /* Factory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Factory.cpp; sourceTree = "<group>"; };
BEF9835C180451CF00E7905D /* Factory.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = Factory.hpp; sourceTree = "<group>"; };
BEF9B60D231E590C009A680D /* Directory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Directory.cpp; sourceTree = "<group>"; };
BEF9B611231E591B009A680D /* Directory.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = Directory.hpp; sourceTree = "<group>"; };
BEF9B613231EA647009A680D /* GetRankDirectory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GetRankDirectory.cpp; sourceTree = "<group>"; };
BEF9B615231EA652009A680D /* GetRankDirectory.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = GetRankDirectory.hpp; sourceTree = "<group>"; };
BEFC32DC1CB53C3B00C8903C /* RefFEltInLocalOperator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RefFEltInLocalOperator.cpp; sourceTree = "<group>"; };
BEFC32DD1CB53C3B00C8903C /* RefFEltInLocalOperator.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = RefFEltInLocalOperator.hpp; sourceTree = "<group>"; };
BEFC32DE1CB53C3B00C8903C /* RefFEltInLocalOperator.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = RefFEltInLocalOperator.hxx; sourceTree = "<group>"; };
......@@ -10734,8 +10734,8 @@
BEF9B60C231E58BB009A680D /* Internal */ = {
isa = PBXGroup;
children = (
BEF9B60D231E590C009A680D /* Directory.cpp */,
BEF9B611231E591B009A680D /* Directory.hpp */,
BEF9B613231EA647009A680D /* GetRankDirectory.cpp */,
BEF9B615231EA652009A680D /* GetRankDirectory.hpp */,
);
path = Internal;
sourceTree = "<group>";
......@@ -11593,7 +11593,7 @@
BE90E18F1A24929A00CCAFDE /* File.hpp in Headers */,
BE44C05B1AA463DF0030FA26 /* Pragma.hpp in Headers */,
0A2CBE981D05B87A007262F2 /* Model.hpp in Headers */,
BEF9B612231E591B009A680D /* Directory.hpp in Headers */,
BEF9B616231EA652009A680D /* GetRankDirectory.hpp in Headers */,
BE4ED31D1A2CBAC400DE374E /* MatrixOperations.hpp in Headers */,
BECEF92D22DF5D5E00D0DDE7 /* Now.hpp in Headers */,
BE90E1B11A24929A00CCAFDE /* Vector.hxx in Headers */,
......@@ -13019,6 +13019,7 @@
BE90E1A91A24929A00CCAFDE /* Matrix.cpp in Sources */,
BE5E406D1AAA088E007F8B1E /* Environment.cpp in Sources */,
BEDEB92E1C3C073100B1C71B /* Snes.cpp in Sources */,
BEF9B614231EA647009A680D /* GetRankDirectory.cpp in Sources */,
BE90E1631A24926E00CCAFDE /* Factory.cpp in Sources */,
BE90E19E1A24929A00CCAFDE /* Op.cpp in Sources */,
BE2195191DF813290014FE44 /* Libmesh.cpp in Sources */,
......@@ -13046,7 +13047,6 @@
BE90E1AF1A24929A00CCAFDE /* Vector.cpp in Sources */,
BE110EA31E11514200D2D2C8 /* VectorHelper.cpp in Sources */,
BE90E1711A24926E00CCAFDE /* String.cpp in Sources */,
BEF9B60F231E590D009A680D /* Directory.cpp in Sources */,
BE35030A22F2E96700D09A4D /* Directory.cpp in Sources */,
BEDEB9281C3C073100B1C71B /* Umfpack.cpp in Sources */,
BECEF92B22DF5D5E00D0DDE7 /* Now.cpp in Sources */,
......@@ -62,6 +62,8 @@ namespace MoReFEM::Internal::MoReFEMDataNS
assert(!(!additional));
additional->Add(cmd);
}
else
static_cast<void>(additional);
cmd.parse(argc, argv);
......@@ -96,7 +98,7 @@ namespace MoReFEM::Internal::MoReFEMDataNS
template<class TupleT>
void CreateIfNotExisting(const std::string& input_data_file)
{
if (!FilesystemNS::File::DoExist(input_data_file))
if (!::MoReFEM::FilesystemNS::File::DoExist(input_data_file))
{
::MoReFEM::Utilities::InputDataNS::CreateDefaultInputFile<TupleT>(input_data_file);
......
......@@ -69,6 +69,7 @@ namespace MoReFEM::Internal
* \brief Constructor.
*
* \copydoc doxygen_hide_input_data_arg
* \copydetails doxygen_hide_mpi_param
* \param[in] behaviour Behaviour to use when the subdirectory to create already exist. Irrelevant for policies
* that only read existing directories.
*/
......@@ -95,7 +96,7 @@ namespace MoReFEM::Internal
///@}
//! Get the path of the parallelism directory.
const FilesystemNS::Directory& GetDirectory() const noexcept;
const ::MoReFEM::FilesystemNS::Directory& GetDirectory() const noexcept;
//! Get the parallelism strategy.
::MoReFEM::Advanced::parallelism_strategy GetParallelismStrategy() const noexcept;
......@@ -107,7 +108,7 @@ namespace MoReFEM::Internal
::MoReFEM::Advanced::parallelism_strategy::none;
//! Path to the parallelism directory.
FilesystemNS::Directory::const_unique_ptr directory_ = nullptr;
::MoReFEM::FilesystemNS::Directory::const_unique_ptr directory_ = nullptr;
};
......
......@@ -49,10 +49,10 @@ namespace MoReFEM::Internal
using directory = ::MoReFEM::InputDataNS::Parallelism::Directory;
std::string path = ipl::Extract<directory>::Path(input_data);
directory_ = std::make_unique<FilesystemNS::Directory>(mpi,
path,
behaviour,
__FILE__, __LINE__);
directory_ = std::make_unique<::MoReFEM::FilesystemNS::Directory>(mpi,
path,
behaviour,
__FILE__, __LINE__);
break;
}
......@@ -63,10 +63,10 @@ namespace MoReFEM::Internal
using directory = ::MoReFEM::InputDataNS::Parallelism::Directory;
std::string path = ipl::Extract<directory>::Path(input_data);
directory_ = std::make_unique<FilesystemNS::Directory>(mpi,
path,
FilesystemNS::behaviour::read,
__FILE__, __LINE__);
directory_ = std::make_unique<::MoReFEM::FilesystemNS::Directory>(mpi,
path,
::MoReFEM::FilesystemNS::behaviour::read,
__FILE__, __LINE__);
break;
}
......@@ -76,7 +76,7 @@ namespace MoReFEM::Internal
}
inline const FilesystemNS::Directory& Parallelism::GetDirectory() const noexcept
inline const ::MoReFEM::FilesystemNS::Directory& Parallelism::GetDirectory() const noexcept
{
assert(!(!directory_));
return *directory_;
......
......@@ -326,7 +326,7 @@ namespace MoReFEM
void CheckPath(const std::string& filename)
{
std::string file_extension(FilesystemNS::File::Extension(filename));
std::string file_extension(::MoReFEM::FilesystemNS::File::Extension(filename));
using traits = TraitsMode<ModeT>;
......
......@@ -48,7 +48,7 @@ namespace MoReFEM
template<class MoReDEMDataT>
void InitGodOfDof(const MoReDEMDataT& morefem_data,
DoConsiderProcessorWiseLocal2Global do_consider_processor_wise_local_2_global,
std::map<unsigned int, FilesystemNS::Directory::const_unique_ptr>&& output_directory_per_mesh_index);
std::map<unsigned int, ::MoReFEM::FilesystemNS::Directory::const_unique_ptr>&& output_directory_per_mesh_index);
......
......@@ -32,7 +32,8 @@ namespace MoReFEM
void InitEachGodOfDof(const MoReDEMDataT& morefem_data,
std::map<unsigned int, FEltSpace::vector_unique_ptr>& felt_space_list_per_god_of_dof_index,
DoConsiderProcessorWiseLocal2Global do_consider_proc_wise_local_2_global,
std::map<unsigned int, FilesystemNS::Directory::const_unique_ptr>&& mesh_output_directory_storage)
std::map<unsigned int, ::MoReFEM::FilesystemNS::Directory::const_unique_ptr>&&
mesh_output_directory_storage)
{
const auto& god_of_dof_storage = GodOfDofManager::GetInstance(__FILE__, __LINE__).GetStorage();
......@@ -65,7 +66,8 @@ namespace MoReFEM
template<class MoReDEMDataT>
void InitGodOfDof(const MoReDEMDataT& morefem_data,
DoConsiderProcessorWiseLocal2Global do_consider_proc_wise_local_2_global,
std::map<unsigned int, FilesystemNS::Directory::const_unique_ptr>&& mesh_output_directory_storage)
std::map<unsigned int, ::MoReFEM::FilesystemNS::Directory::const_unique_ptr>&&
mesh_output_directory_storage)
{
std::map<unsigned int, FEltSpace::vector_unique_ptr> felt_space_list_per_god_of_dof_index;
......
......@@ -51,7 +51,7 @@
out.max_load_factor(Utilities::DefaultMaxLoadFactor());
std::ifstream stream;
FilesystemNS::File::Read(stream, fiber_file, __FILE__, __LINE__);
::MoReFEM::FilesystemNS::File::Read(stream, fiber_file, __FILE__, __LINE__);
std::string line;
......@@ -186,7 +186,7 @@
constexpr auto Nvalue_per_vertex = TraitsT::NvaluePerVertex();
std::ifstream stream;
FilesystemNS::File::Read(stream, fiber_file, __FILE__, __LINE__);
::MoReFEM::FilesystemNS::File::Read(stream, fiber_file, __FILE__, __LINE__);
std::string line;
......
......@@ -16,7 +16,7 @@
#include "Utilities/String/String.hpp"
#include "Utilities/OutputFormat/ReadBinaryFile.hpp"
#include "Utilities/Filesystem/Internal/Directory.hpp"
#include "Utilities/Filesystem/Internal/GetRankDirectory.hpp"
#include "Core/NumberingSubset/NumberingSubset.hpp"
......
......@@ -277,19 +277,6 @@ namespace MoReFEM::FilesystemNS
}
void Directory::CheckForSubdirectoryConstructor(const Directory& parent_directory,
const char* invoking_file, int invoking_line) const
{
if (!Folder::DoExist(parent_directory.GetPath()))
{
std::ostringstream oconv;
oconv << "Directory '" << parent_directory.GetPath() << "' couldn't be found whereas we were trying to build a "
"subdirectory from it (so the directory has been created at some point and then removed).";
throw Exception(oconv.str(), invoking_file, invoking_line);
}
}
namespace // anonymous
{
......@@ -371,6 +358,7 @@ namespace MoReFEM::FilesystemNS
ret);
assert(Nmodif == 1 && "Should be relevant only for directory created with add_rank::yes.");
static_cast<void>(Nmodif);
return ret;
}
......@@ -387,3 +375,35 @@ namespace MoReFEM::FilesystemNS
} // namespace MoReFEM::FilesystemNS
namespace MoReFEM::Internal::FilesystemNS
{
namespace // anonymous
{
using Directory = ::MoReFEM::FilesystemNS::Directory;
} // namespace anonymous
void CheckForSubdirectoryConstructor(const Directory& parent_directory,
const char* invoking_file, int invoking_line)
{
if (!::MoReFEM::FilesystemNS::Folder::DoExist(parent_directory.GetPath()))
{
std::ostringstream oconv;
oconv << "Directory '" << parent_directory.GetPath() << "' couldn't be found whereas we were trying to build a "
"subdirectory from it (so the directory has been created at some point and then removed).";
throw Exception(oconv.str(), invoking_file, invoking_line);
}
}
} // namespace MoReFEM::Internal::FilesystemNS
......@@ -56,7 +56,7 @@ namespace MoReFEM::FilesystemNS
};
//! \copydoc doxygen_hide_std_stream_out_overload
std::ostream& operator<<(std::ostream& out, behaviour rhs);
std::ostream& operator<<(std::ostream& stream, behaviour rhs);
/*!
......@@ -121,10 +121,8 @@ namespace MoReFEM::FilesystemNS
* \brief Simple constructor: no mpi involved - so no rank whatsoever added.
*
* \copydoc doxygen_hide_invoking_file_and_line
* \copydoc doxygen_hide_mpi_param
* \copydoc doxygen_hide_directory_behaviour_param
* \param[in] path Unix path of the directory.
* \param[in] do_add_rank Whether a "Rank_" part is added to the path.
*/
explicit Directory(const std::string& path,
behaviour directory_behaviour,
......@@ -132,27 +130,41 @@ namespace MoReFEM::FilesystemNS
/*!
* \brief Constructor of a \a Directory which is a subdirectory on an already existing \a Directory.
* \class doxygen_hide_subdirectory_constructor
*
* \param[in] parent_directory The directory into which the new one is created (or read - depends on behaviour).
* The constructed directory takes the same attributes than its parent directory - except obviously for the path.
* \param[in] subdirectory Name of the subdirectory relative to \a parent_directory.
* \copydoc doxygen_hide_invoking_file_and_line
* \copydoc directory_behaviour_ptr Pointer to directory behaviour; if nullptr the behaviour of the parent
* \param[in] directory_behaviour_ptr Pointer to directory behaviour; if nullptr the behaviour of the parent
* directory is used (you should stick with this choice most of the time),
*
* \tparam StringT Type of \a subdirectory, which may actually be anything for which operator<< has been
* overloaded (avoid nonetheless values with spaces inside...)
*/
/*!
* \brief Constructor of a \a Directory which is a subdirectory on an already existing \a parent_directory.
*
* \param[in] subdirectory Name of the subdirectory relative to \a parent_directory.
* \copydetails doxygen_hide_subdirectory_constructor
*/
template<class StringT>
explicit Directory(const Directory& parent_directory,
const StringT& subdirectory,
const char* invoking_file, int invoking_line,
std::unique_ptr<behaviour> directory_behaviour_ptr = nullptr);
/*!
* \brief Constructor of a \a Directory which is several layers of directories inside an already existing
* \a parent_directory.
*
* \param[in] layers Names of the layers of subdirectories. For instance if { "Foo", "Bar"}, it will create
* inside \a parent_directory the subdirectory "Foo/Bar/".
* \copydetails doxygen_hide_subdirectory_constructor
*/
template<class StringT>
explicit Directory(const Directory& parent_directory,
const std::vector<StringT>& subdirectories,
const std::vector<StringT>& layers,
const char* invoking_file, int invoking_line,
std::unique_ptr<behaviour> directory_behaviour_ptr = nullptr);
......@@ -166,7 +178,7 @@ namespace MoReFEM::FilesystemNS
Directory(Directory&& rhs) = default;
//! \copydoc doxygen_hide_copy_affectation
Directory& operator=(const Directory& rhs) = default;
Directory& operator=(const Directory& rhs) = delete;
//! \copydoc doxygen_hide_move_affectation
Directory& operator=(Directory&& rhs) = default;
......@@ -188,9 +200,6 @@ namespace MoReFEM::FilesystemNS
*/
std::string AddFile(const std::string& filename) const;
void AddSubdirectory(const std::string& subdirectory, const char* invoking_file, int invoking_line);
//! Returns the behaviour.
behaviour GetBehaviour() const noexcept;
......@@ -213,6 +222,20 @@ namespace MoReFEM::FilesystemNS
//! Whether a rank was given in construction.
bool IsWithRank() const noexcept;
public:
/*!
* \brief Modify current directory so that it points to a subdirectory.
*
* \attention It is NOT the preferred way to create a subdirectory: it is much better to create another
* \a Directory object with the proper constructor to do so. However, it is handy as it cut short the code
* for testing models outputs and comparing them to the stored expected results.
*
* \param[in] subdirectory Name of the subdirectory layer that will hence be pointed by current object.
* \copydoc doxygen_hide_invoking_file_and_line
*/
void AddSubdirectory(const std::string& subdirectory, const char* invoking_file, int invoking_line);
private:
/*!
......@@ -237,11 +260,6 @@ namespace MoReFEM::FilesystemNS
//! Accessor to Mpi pointer - required to define some constructors.
const Wrappers::Mpi* GetMpiPtr() const noexcept;
void CheckForSubdirectoryConstructor(const Directory& parent_directory,
const char* invoking_file, int invoking_line) const;
private:
//! Path of the directory.
......@@ -265,7 +283,7 @@ namespace MoReFEM::FilesystemNS
//! \copydoc doxygen_hide_std_stream_out_overload
std::ostream& operator<<(std::ostream& out, const Directory& rhs);
std::ostream& operator<<(std::ostream& stream, const Directory& rhs);
/*!
......@@ -292,6 +310,23 @@ namespace MoReFEM::FilesystemNS
} // namespace MoReFEM::FilesystemNS
namespace MoReFEM::Internal::FilesystemNS
{
/*!
* \brief Helper function for subdirectory constructors.
*
* \param[in] parent_directory The directory from which a subdirectory is to be constructed.
* \copydoc doxygen_hide_invoking_file_and_line
*/
void CheckForSubdirectoryConstructor(const ::MoReFEM::FilesystemNS::Directory& parent_directory,
const char* invoking_file, int invoking_line);
} // namespace MoReFEM::Internal::FilesystemNS
# include "Utilities/Filesystem/Directory.hxx"
......
......@@ -25,7 +25,7 @@ namespace MoReFEM::FilesystemNS
directory_behaviour_(directory_behaviour_ptr == nullptr ? parent_directory.GetBehaviour() : *directory_behaviour_ptr),
with_rank_(parent_directory.IsWithRank())
{
CheckForSubdirectoryConstructor(parent_directory, invoking_file, invoking_line);
Internal::FilesystemNS::CheckForSubdirectoryConstructor(parent_directory, invoking_file, invoking_line);
std::ostringstream oconv;
oconv << parent_directory.GetPath() << subdirectory << '/';
......@@ -44,7 +44,7 @@ namespace MoReFEM::FilesystemNS
directory_behaviour_(directory_behaviour_ptr == nullptr ? parent_directory.GetBehaviour() : *directory_behaviour_ptr),
with_rank_(parent_directory.IsWithRank())
{
CheckForSubdirectoryConstructor(parent_directory, invoking_file, invoking_line);
Internal::FilesystemNS::CheckForSubdirectoryConstructor(parent_directory, invoking_file, invoking_line);
std::ostringstream oconv;
oconv << parent_directory.GetPath();
......@@ -102,4 +102,7 @@ namespace MoReFEM::FilesystemNS
} // namespace MoReFEM::FilesystemNS
#endif // MOREFEM_x_UTILITIES_x_FILESYSTEM_x_DIRECTORY_HXX_
......@@ -10,7 +10,7 @@
#include <memory>
#include "Utilities/Filesystem/Internal/Directory.hpp"
#include "Utilities/Filesystem/Internal/GetRankDirectory.hpp"
namespace MoReFEM::Internal::FilesystemNS
......
......@@ -8,8 +8,8 @@
//Copyright © 2019 Inria. All rights reserved.
//
#ifndef MOREFEM_x_UTILITIES_x_FILESYSTEM_x_INTERNAL_x_DIRECTORY_HPP_
# define MOREFEM_x_UTILITIES_x_FILESYSTEM_x_INTERNAL_x_DIRECTORY_HPP_
#ifndef MOREFEM_x_UTILITIES_x_FILESYSTEM_x_INTERNAL_x_GET_RANK_DIRECTORY_HPP_
# define MOREFEM_x_UTILITIES_x_FILESYSTEM_x_INTERNAL_x_GET_RANK_DIRECTORY_HPP_
# include "Utilities/Filesystem/Directory.hpp"
......@@ -42,4 +42,4 @@ namespace MoReFEM::Internal::FilesystemNS
} // namespace MoReFEM::Internal::FilesystemNS
#endif // MOREFEM_x_UTILITIES_x_FILESYSTEM_x_INTERNAL_x_DIRECTORY_HPP_
#endif // MOREFEM_x_UTILITIES_x_FILESYSTEM_x_INTERNAL_x_GET_RANK_DIRECTORY_HPP_
......@@ -10,9 +10,9 @@
target_sources(${MOREFEM_UTILITIES}
PRIVATE
"${CMAKE_CURRENT_LIST_DIR}/Directory.cpp"
"${CMAKE_CURRENT_LIST_DIR}/GetRankDirectory.cpp"
PRIVATE
"${CMAKE_CURRENT_LIST_DIR}/Directory.hpp"
"${CMAKE_CURRENT_LIST_DIR}/GetRankDirectory.hpp"
)
......@@ -21,5 +21,4 @@ target_sources(${MOREFEM_UTILITIES}
"${CMAKE_CURRENT_LIST_DIR}/Folder.hpp"
)
include(${CMAKE_CURRENT_LIST_DIR}/Advanced/SourceList.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/Internal/SourceList.cmake)
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