Commit b3f4158a authored by GILLES Sebastien's avatar GILLES Sebastien
Browse files

#9 Utilities: add a FilesystemNS to enclose File and Folder namespaces. Refine...

#9 Utilities: add a FilesystemNS to enclose File and Folder namespaces. Refine Doxygen group documentation.
parent 0943458b
......@@ -790,7 +790,7 @@ INPUT_ENCODING = UTF-8
# *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.f90, *.f, *.for, *.tcl, *.vhd,
# *.vhdl, *.ucf, *.qsf, *.as and *.js.
FILE_PATTERNS = *.hpp
FILE_PATTERNS = *.hpp *.doxygen
# The RECURSIVE tag can be used to specify whether or not subdirectories should
# be searched for input files as well.
......
......@@ -205,7 +205,8 @@
BE1E87621B8DFB710002EE64 /* PrepareDefaultEntry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BE1E875F1B8DFB710002EE64 /* PrepareDefaultEntry.cpp */; };
BE1E87631B8DFB710002EE64 /* PrepareDefaultEntry.hpp in Headers */ = {isa = PBXBuildFile; fileRef = BE1E87601B8DFB710002EE64 /* PrepareDefaultEntry.hpp */; };
BE1E87641B8DFB710002EE64 /* PrepareDefaultEntry.hxx in Headers */ = {isa = PBXBuildFile; fileRef = BE1E87611B8DFB710002EE64 /* PrepareDefaultEntry.hxx */; };
BE2592141C9ABA6900DF404B /* Utilities_doxygen.hpp in Headers */ = {isa = PBXBuildFile; fileRef = BE2592131C9ABA6900DF404B /* Utilities_doxygen.hpp */; };
BE2592141C9ABA6900DF404B /* Utilities.doxygen in Headers */ = {isa = PBXBuildFile; fileRef = BE2592131C9ABA6900DF404B /* Utilities.doxygen */; };
BE2592171C9AC0F800DF404B /* HappyHeart.doxygen in Headers */ = {isa = PBXBuildFile; fileRef = BE2592161C9AC0F800DF404B /* HappyHeart.doxygen */; };
BE2801E01C7F06E400FD01BC /* DerivativeGreenLagrange.hpp in Headers */ = {isa = PBXBuildFile; fileRef = BE2801DD1C7F06E400FD01BC /* DerivativeGreenLagrange.hpp */; };
BE2801E11C7F06E400FD01BC /* DerivativeGreenLagrange.hxx in Headers */ = {isa = PBXBuildFile; fileRef = BE2801DE1C7F06E400FD01BC /* DerivativeGreenLagrange.hxx */; };
BE2801E51C7F172500FD01BC /* CauchyGreenTensor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BE2801E21C7F172500FD01BC /* CauchyGreenTensor.cpp */; };
......@@ -3980,7 +3981,8 @@
BE2241BD19FA5FDE00B90563 /* InterfaceSpecialization.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = InterfaceSpecialization.hpp; sourceTree = "<group>"; };
BE2241BE19FA5FDE00B90563 /* InterfaceSpecialization.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = InterfaceSpecialization.hxx; sourceTree = "<group>"; };
BE2590A6196ACE1600E28AD9 /* TimeScheme.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = TimeScheme.hpp; sourceTree = "<group>"; };
BE2592131C9ABA6900DF404B /* Utilities_doxygen.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = Utilities_doxygen.hpp; sourceTree = "<group>"; };
BE2592131C9ABA6900DF404B /* Utilities.doxygen */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Utilities.doxygen; sourceTree = "<group>"; };
BE2592161C9AC0F800DF404B /* HappyHeart.doxygen */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = HappyHeart.doxygen; path = Sources/HappyHeart.doxygen; sourceTree = "<group>"; };
BE2801DD1C7F06E400FD01BC /* DerivativeGreenLagrange.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = DerivativeGreenLagrange.hpp; sourceTree = "<group>"; };
BE2801DE1C7F06E400FD01BC /* DerivativeGreenLagrange.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = DerivativeGreenLagrange.hxx; sourceTree = "<group>"; };
BE2801E21C7F172500FD01BC /* CauchyGreenTensor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CauchyGreenTensor.cpp; sourceTree = "<group>"; };
......@@ -6861,6 +6863,7 @@
children = (
BEB5009B18DC5BA900C7EFB6 /* TAGS */,
BE5BE43019336D45006BE2BF /* SConstruct */,
BE2592161C9AC0F800DF404B /* HappyHeart.doxygen */,
BEC37E0617DDC0210021BFB7 /* Accelerate.framework */,
BE5BC3C116C015A100232749 /* Utilities */,
BE5BC2E916C0129000232749 /* ThirdParty */,
......@@ -7074,7 +7077,7 @@
BE5BC3C116C015A100232749 /* Utilities */ = {
isa = PBXGroup;
children = (
BE2592131C9ABA6900DF404B /* Utilities_doxygen.hpp */,
BE2592131C9ABA6900DF404B /* Utilities.doxygen */,
BE5BE50719336DD1006BE2BF /* SConscript */,
BE501D031A2DC03900B92486 /* MatrixOrVector.hpp */,
BE5BC3C216C015B800232749 /* Miscellaneous.hpp */,
......@@ -9947,6 +9950,7 @@
BEDEB9261C3C073100B1C71B /* Mumps.hpp in Headers */,
BE90E1B91A24929A00CCAFDE /* Print.hpp in Headers */,
BE5B6F8D1C3C16E9004A0284 /* MatrixOperations.hxx in Headers */,
BE2592171C9AC0F800DF404B /* HappyHeart.doxygen in Headers */,
BEDEB92C1C3C073100B1C71B /* Solver.hpp in Headers */,
BEEABA641A49CB5A00A875C6 /* CommandLineOptions.hpp in Headers */,
BE6F5A2D1A8396840076DF90 /* HappyHeartPetscVector.hxx in Headers */,
......@@ -10080,7 +10084,7 @@
BE90E1851A24929A00CCAFDE /* ExceptionHelper.hpp in Headers */,
BE1E875A1B8DDCB60002EE64 /* StaticIf.hxx in Headers */,
BE41A8D01A24AA59004E4312 /* Petsc.hxx in Headers */,
BE2592141C9ABA6900DF404B /* Utilities_doxygen.hpp in Headers */,
BE2592141C9ABA6900DF404B /* Utilities.doxygen in Headers */,
BE90E1C31A2492AA00CCAFDE /* SubVector.hpp in Headers */,
BEDEB92F1C3C073100B1C71B /* Snes.hpp in Headers */,
BE90E1781A24926E00CCAFDE /* Singleton.hpp in Headers */,
......
......@@ -61,7 +61,7 @@ namespace HappyHeart
// Check the input parameter file can be found on each processor.
const bool do_file_exist_for_rank = File::DoExist(input_parameter_file) ;
const bool do_file_exist_for_rank = FilesystemNS::File::DoExist(input_parameter_file) ;
std::vector<bool> sent_data { do_file_exist_for_rank };
std::vector<bool> gathered_data;
......
......@@ -35,7 +35,7 @@ namespace HappyHeart
std::ofstream out;
File::Create(out, time_log_filename, __FILE__, __LINE__);
FilesystemNS::File::Create(out, time_log_filename, __FILE__, __LINE__);
TimeKeep::CreateOrGetInstance(std::move(out));
}
......
......@@ -809,10 +809,10 @@ namespace HappyHeart
if (mpi.IsRootProcessor())
{
if (!File::DoExist(time_iteration_file_))
if (!FilesystemNS::File::DoExist(time_iteration_file_))
{
std::ofstream stream;
File::Create(stream, time_iteration_file_, __FILE__, __LINE__);
FilesystemNS::File::Create(stream, time_iteration_file_, __FILE__, __LINE__);
stream << "# Time iteration; time; filename" << std::endl;
}
}
......@@ -831,8 +831,8 @@ namespace HappyHeart
auto&& subfolder = GetOutputDirectoryForNumberingSubset(numbering_subset);
if (!Folder::DoExist(subfolder)) // \todo #497
Folder::Create(subfolder, __FILE__, __LINE__);
if (!FilesystemNS::Folder::DoExist(subfolder)) // \todo #497
FilesystemNS::Folder::Create(subfolder, __FILE__, __LINE__);
}
}
......@@ -853,7 +853,7 @@ namespace HappyHeart
std::ostringstream oconv;
oconv << subfolder << "/dof_information_proc_" << mpi.GetRank<int>() << ".hhdata";
std::ofstream out;
File::Create(out, oconv.str(), __FILE__, __LINE__);
FilesystemNS::File::Create(out, oconv.str(), __FILE__, __LINE__);
PrintDofInformation(numbering_subset, out);
}
}
......@@ -876,10 +876,10 @@ namespace HappyHeart
if (mpi.IsRootProcessor())
{
if (Folder::DoExist(output_directory_))
Folder::Remove(output_directory_, __FILE__, __LINE__);
if (FilesystemNS::Folder::DoExist(output_directory_))
FilesystemNS::Folder::Remove(output_directory_, __FILE__, __LINE__);
Folder::Create(output_directory_, __FILE__, __LINE__);
FilesystemNS::Folder::Create(output_directory_, __FILE__, __LINE__);
}
mpi.Barrier();
......
......@@ -165,7 +165,7 @@ namespace HappyHeart
inline const std::string& GodOfDof::GetOutputDirectory() const
{
assert(!(!Folder::DoExist(output_directory_)));
assert(!(!FilesystemNS::Folder::DoExist(output_directory_)));
return output_directory_;
}
......
......@@ -117,7 +117,7 @@ namespace HappyHeart
std::ostringstream oconv;
oconv << output_directory << "/unknowns.hhdata";
std::ofstream out;
File::Create(out, oconv.str(), __FILE__, __LINE__);
FilesystemNS::File::Create(out, oconv.str(), __FILE__, __LINE__);
const auto& storage = UnknownManager::GetInstance().GetList();
......
......@@ -306,7 +306,7 @@ namespace HappyHeart
if (mpi.IsRootProcessor())
{
std::fstream inout;
File::Append(inout, GetGodOfDof().GetTimeIterationFile(), __FILE__, __LINE__);
FilesystemNS::File::Append(inout, GetGodOfDof().GetTimeIterationFile(), __FILE__, __LINE__);
oconv.str("");
oconv << common_part_for_same_time_iteration << "*.hhdata";
......
......@@ -342,7 +342,7 @@ namespace HappyHeart
oconv << output_directory << "/interfaces_" << mesh.GetUniqueId() << ".hhdata";
std::ofstream out;
File::Create(out, oconv.str(), __FILE__, __LINE__);
FilesystemNS::File::Create(out, oconv.str(), __FILE__, __LINE__);
Private::MeshLevelInterfaceList mesh_interface_list(mesh);
mesh_interface_list.Print(out);
......
......@@ -478,7 +478,7 @@ namespace HappyHeart
// hence these tests to check some of the possible mishaps beforehand.
{
std::string file_extension(File::Extension(medit_filename));
std::string file_extension(FilesystemNS::File::Extension(medit_filename));
if (file_extension != "mesh" && file_extension != "meshb")
throw ExceptionNS::Format::Medit::InvalidExtension(medit_filename, "write", __FILE__, __LINE__);
......
......@@ -32,7 +32,7 @@ namespace HappyHeart
void VertexMatching::Read(const std::string& filename)
{
std::ifstream in;
File::Read(in, filename, __FILE__, __LINE__);
FilesystemNS::File::Read(in, filename, __FILE__, __LINE__);
std::string line;
......
/// \namespace HappyHeart
/// \brief Main HappyHeart namespace.
......@@ -62,7 +62,7 @@ namespace HappyHeart
target += "/mpi.hhdata";
std::ofstream out;
File::Create(out, target, __FILE__, __LINE__);
FilesystemNS::File::Create(out, target, __FILE__, __LINE__);
out << "Nprocessor: " << mpi.template Nprocessor<int>() << std::endl;
}
......
......@@ -101,8 +101,8 @@ namespace HappyHeart
const auto& mpi = this->MpiHappyHeart();
if (mpi.IsRootProcessor() && !Folder::DoExist(gate_directory_))
Folder::Create(gate_directory_, __FILE__, __LINE__);
if (mpi.IsRootProcessor() && !FilesystemNS::Folder::DoExist(gate_directory_))
FilesystemNS::Folder::Create(gate_directory_, __FILE__, __LINE__);
mpi.Barrier();
......@@ -657,7 +657,7 @@ namespace HappyHeart
::GetGateDirectory() const noexcept
{
assert(!gate_directory_.empty());
assert(Folder::DoExist(gate_directory_));
assert(FilesystemNS::Folder::DoExist(gate_directory_));
return gate_directory_;
}
......
......@@ -47,7 +47,7 @@ namespace HappyHeart
out.max_load_factor(Utilities::DefaultMaxLoadFactor());
std::ifstream stream;
File::Read(stream, fiber_file, __FILE__, __LINE__);
FilesystemNS::File::Read(stream, fiber_file, __FILE__, __LINE__);
std::string line;
......@@ -169,7 +169,7 @@ namespace HappyHeart
constexpr auto Nvalue_per_vertex = TraitsT::NvaluePerVertex();
std::ifstream stream;
File::Read(stream, fiber_file, __FILE__, __LINE__);
FilesystemNS::File::Read(stream, fiber_file, __FILE__, __LINE__);
std::string line;
......
......@@ -49,7 +49,7 @@ namespace HappyHeart
inline void Parameter<TypeT>::Write(const std::string& filename) const
{
std::ofstream out;
File::Create(out, filename, __FILE__, __LINE__);
FilesystemNS::File::Create(out, filename, __FILE__, __LINE__);
this->Write(out);
}
......
......@@ -105,7 +105,7 @@ namespace HappyHeart
std::ofstream stream;
File::Create(stream, case_file, __FILE__, __LINE__);
FilesystemNS::File::Create(stream, case_file, __FILE__, __LINE__);
stream << "FORMAT" << std::endl;
stream << "type: ensight" << std::endl;
......@@ -189,7 +189,7 @@ namespace HappyHeart
std::ofstream ensight_output_stream;
File::Create(ensight_output_stream, ensight_output_file, __FILE__, __LINE__);
FilesystemNS::File::Create(ensight_output_stream, ensight_output_file, __FILE__, __LINE__);
ensight_output_stream << "First line which content must be chosen (but later)" << std::endl;
......
......@@ -68,7 +68,7 @@ namespace HappyHeart
oconv << "solution_" << std::setfill('0') << std::setw(5) << time_iteration_index << "_proc"
<< processor << ".hhdata";
File::Read(stream, oconv.str(), __FILE__, __LINE__);
FilesystemNS::File::Read(stream, oconv.str(), __FILE__, __LINE__);
std::string line;
......@@ -115,7 +115,7 @@ namespace HappyHeart
assert(Nprocessor_ == NumericNS::UninitializedIndex<std::size_t>());
std::ifstream in;
File::Read(in, GetDataDirectory() + "/mpi.hhdata", __FILE__, __LINE__);
FilesystemNS::File::Read(in, GetDataDirectory() + "/mpi.hhdata", __FILE__, __LINE__);
std::string line;
getline(in, line);
......
......@@ -65,7 +65,7 @@ namespace HappyHeart
std::ifstream interface_stream;
File::Read(interface_stream, input_file, __FILE__, __LINE__);
FilesystemNS::File::Read(interface_stream, input_file, __FILE__, __LINE__);
std::string line;
......
......@@ -36,7 +36,7 @@ namespace HappyHeart
{
std::ifstream interface_stream;
File::Read(interface_stream, input_file, __FILE__, __LINE__);
FilesystemNS::File::Read(interface_stream, input_file, __FILE__, __LINE__);
std::string line;
......
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