From 117ff6b532bc91d146471b613858207f2edd9206 Mon Sep 17 00:00:00 2001 From: MelReyCG Date: Tue, 23 Jul 2024 11:56:30 +0200 Subject: [PATCH 01/24] todos --- src/coreComponents/common/CMakeLists.txt | 3 +++ src/coreComponents/common/FieldSpecificationOps.hpp | 2 +- src/coreComponents/common/Logger.cpp | 2 +- src/coreComponents/common/MultiMutexesLock.hpp | 2 +- src/coreComponents/common/Span.hpp | 2 +- src/coreComponents/common/initializeEnvironment.cpp | 6 +++--- 6 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/coreComponents/common/CMakeLists.txt b/src/coreComponents/common/CMakeLists.txt index ea5e2409bf3..ae7acd0b611 100644 --- a/src/coreComponents/common/CMakeLists.txt +++ b/src/coreComponents/common/CMakeLists.txt @@ -95,6 +95,9 @@ if( ENABLE_CALIPER ) endif() endif() + # TODO: remove codingUtilities (move StringUtilities in common) + # remove fileIO (move "Table/*" into a "format/table/*" package) + # add basicIO/* and put Logger in it set( dependencyList ${dependencyList} fileIO codingUtilities ) blt_add_library( NAME common diff --git a/src/coreComponents/common/FieldSpecificationOps.hpp b/src/coreComponents/common/FieldSpecificationOps.hpp index 684b90af9e5..4acd27b6fd6 100644 --- a/src/coreComponents/common/FieldSpecificationOps.hpp +++ b/src/coreComponents/common/FieldSpecificationOps.hpp @@ -20,7 +20,7 @@ #ifndef GEOS_COMMON_FIELDSPECIFICATIONOPS_HPP #define GEOS_COMMON_FIELDSPECIFICATIONOPS_HPP -#include "codingUtilities/traits.hpp" +#include "codingUtilities/traits.hpp" // why? what can we do about it? can we just ignore it for now? #include "common/DataTypes.hpp" #include "common/GEOS_RAJA_Interface.hpp" diff --git a/src/coreComponents/common/Logger.cpp b/src/coreComponents/common/Logger.cpp index 77a8946b000..b893007a2de 100644 --- a/src/coreComponents/common/Logger.cpp +++ b/src/coreComponents/common/Logger.cpp @@ -20,7 +20,7 @@ // Source includes #include "Logger.hpp" #include "Path.hpp" -#include "codingUtilities/StringUtilities.hpp" +#include "codingUtilities/StringUtilities.hpp" // TODO: -> format/ namespace geos { diff --git a/src/coreComponents/common/MultiMutexesLock.hpp b/src/coreComponents/common/MultiMutexesLock.hpp index f338fea4478..50444972a32 100644 --- a/src/coreComponents/common/MultiMutexesLock.hpp +++ b/src/coreComponents/common/MultiMutexesLock.hpp @@ -19,7 +19,7 @@ #include #include -#include "codingUtilities/Utilities.hpp" +#include "codingUtilities/Utilities.hpp" // TODO: -> common/ namespace geos { diff --git a/src/coreComponents/common/Span.hpp b/src/coreComponents/common/Span.hpp index 40c6c180576..cc6ec8fb340 100644 --- a/src/coreComponents/common/Span.hpp +++ b/src/coreComponents/common/Span.hpp @@ -20,7 +20,7 @@ #ifndef GEOS_COMMON_SPAN_HPP #define GEOS_COMMON_SPAN_HPP -#include "codingUtilities/traits.hpp" +#include "codingUtilities/traits.hpp" // TODO: why? what can we do about it? can we just ignore it for now? #include "common/Logger.hpp" #include diff --git a/src/coreComponents/common/initializeEnvironment.cpp b/src/coreComponents/common/initializeEnvironment.cpp index 4d69cc878fa..15a1b78839b 100644 --- a/src/coreComponents/common/initializeEnvironment.cpp +++ b/src/coreComponents/common/initializeEnvironment.cpp @@ -18,9 +18,9 @@ #include "TimingMacros.hpp" #include "Path.hpp" #include "LvArray/src/system.hpp" -#include "fileIO/Table/TableLayout.hpp" -#include "fileIO/Table/TableData.hpp" -#include "fileIO/Table/TableFormatter.hpp" +#include "fileIO/Table/TableLayout.hpp" // TODO: -> basicIO/ +#include "fileIO/Table/TableData.hpp" // TODO: -> basicIO/ +#include "fileIO/Table/TableFormatter.hpp" // TODO: -> basicIO/ #include "common/LifoStorageCommon.hpp" #include "common/MemoryInfos.hpp" #include From 4e16a416b23ad28913185e21874b6b150ee7f8a1 Mon Sep 17 00:00:00 2001 From: MelReyCG Date: Fri, 26 Jul 2024 10:40:37 +0200 Subject: [PATCH 02/24] DataTypes.hpp now only manage static types - no runtime types nor Mpi constants - DataTypes.cpp is not useful anymore. --- .../codingUtilities/CMakeLists.txt | 4 +- .../codingUtilities/EnumStrings.hpp | 1 + .../RTTypes.cpp} | 11 +- .../codingUtilities/RTTypes.hpp | 202 +++++++++++++++++ src/coreComponents/common/CMakeLists.txt | 1 - src/coreComponents/common/DataTypes.hpp | 205 +----------------- src/coreComponents/common/Format.hpp | 31 +++ src/coreComponents/common/MpiWrapper.cpp | 6 + src/coreComponents/common/MpiWrapper.hpp | 7 + .../dataRepository/xmlWrapper.hpp | 1 + .../fileIO/timeHistory/HDFHistoryIO.hpp | 1 + 11 files changed, 256 insertions(+), 214 deletions(-) rename src/coreComponents/{common/DataTypes.cpp => codingUtilities/RTTypes.cpp} (98%) create mode 100644 src/coreComponents/codingUtilities/RTTypes.hpp diff --git a/src/coreComponents/codingUtilities/CMakeLists.txt b/src/coreComponents/codingUtilities/CMakeLists.txt index 080d9b8d262..29d137ba925 100644 --- a/src/coreComponents/codingUtilities/CMakeLists.txt +++ b/src/coreComponents/codingUtilities/CMakeLists.txt @@ -3,6 +3,7 @@ # set( codingUtilities_headers EnumStrings.hpp + RTTypes.hpp Parsing.hpp SFINAE_Macros.hpp StringUtilities.hpp @@ -16,8 +17,9 @@ set( codingUtilities_headers # set( codingUtilities_sources Parsing.cpp + RTTypes.cpp StringUtilities.cpp - ) + ) set( dependencyList ${parallelDeps} common fast_float ) diff --git a/src/coreComponents/codingUtilities/EnumStrings.hpp b/src/coreComponents/codingUtilities/EnumStrings.hpp index 557562c1e3c..449bf4790b7 100644 --- a/src/coreComponents/codingUtilities/EnumStrings.hpp +++ b/src/coreComponents/codingUtilities/EnumStrings.hpp @@ -26,6 +26,7 @@ #define GEOS_CODINGUTILITIES_ENUMSTRINGS_HPP #include "codingUtilities/StringUtilities.hpp" +#include "codingUtilities/RTTypes.hpp" #include "common/DataTypes.hpp" #include "common/Logger.hpp" #include "common/Format.hpp" diff --git a/src/coreComponents/common/DataTypes.cpp b/src/coreComponents/codingUtilities/RTTypes.cpp similarity index 98% rename from src/coreComponents/common/DataTypes.cpp rename to src/coreComponents/codingUtilities/RTTypes.cpp index 4672907c1ad..486db14e52a 100644 --- a/src/coreComponents/common/DataTypes.cpp +++ b/src/coreComponents/codingUtilities/RTTypes.cpp @@ -14,23 +14,16 @@ */ /** - * @file DataTypes.cpp + * @file RTTypes.cpp */ -#include "DataTypes.hpp" -#include "Logger.hpp" +#include "RTTypes.hpp" #include "LvArray/src/system.hpp" #include "codingUtilities/StringUtilities.hpp" namespace geos { -#ifdef GEOS_USE_MPI -MPI_Comm MPI_COMM_GEOSX; -#else -int MPI_COMM_GEOSX = 0; -#endif - Regex::Regex( string_view regexStr, string_view formatDescription ): m_regexStr( regexStr ), diff --git a/src/coreComponents/codingUtilities/RTTypes.hpp b/src/coreComponents/codingUtilities/RTTypes.hpp new file mode 100644 index 00000000000..16ca875a146 --- /dev/null +++ b/src/coreComponents/codingUtilities/RTTypes.hpp @@ -0,0 +1,202 @@ +/* + * ------------------------------------------------------------------------------------------------------------ + * SPDX-License-Identifier: LGPL-2.1-only + * + * Copyright (c) 2016-2024 Lawrence Livermore National Security LLC + * Copyright (c) 2018-2024 Total, S.A + * Copyright (c) 2018-2024 The Board of Trustees of the Leland Stanford Junior University + * Copyright (c) 2018-2024 Chevron + * Copyright (c) 2019- GEOS/GEOSX Contributors + * All rights reserved + * + * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details. + * ------------------------------------------------------------------------------------------------------------ + */ + +/** + * @file RTTypes.hpp + * + * This file contains various aliases and functions that provide operations regarding the + * use of the runtime types. + */ + +#ifndef GEOS_CODINGUTILITIES_RTTYPES_HPP +#define GEOS_CODINGUTILITIES_RTTYPES_HPP + +#include "common/DataTypes.hpp" + +namespace geos +{ + +/** + * @brief Print a short summary of a few select type aliases. + */ +void printTypeSummary(); + +/** + * @brief The regular expression data for validating inputs. Use rtTypes to get the regex of a + * type, and TypeRegex< T > to define a type regex. + */ +struct Regex +{ + /** + * @brief the regular expression string. + */ + string m_regexStr; + /** + * @brief the description of the expected format of the regular expression. + */ + string m_formatDescription; + /** + * @brief Default constructor + */ + Regex() {} + /** + * @param regexStr the regex string for validation (eg. "[\\d]+") + * @param formatDescription the description of the expected format to be validated (eg. "Input value must be an integer."). + */ + Regex( string_view regexStr, string_view formatDescription ); +}; + +/** + * @brief Extension point for custom types to provide a validation regexp to schema. + * Do not use directly to obtain a type regex, rtTypes::getTypeRegex< T >() should be used instead. + * @tparam T the type for which the regex is defined + * @tparam ENABLE used to conditionally enable partial specializations + * + * Specializations should define the following method: + * \code{cpp} + * static string get(); + * \endcode + */ +template< typename T, typename ENABLE = void > +struct TypeRegex +{ + /** + * @brief Get the type's regex (default implementation returns nothing). + * @return The Regex associated with T. + */ + static Regex get() { return {}; } +}; + +/** + * @brief Static class to manage the type selection of types at runtime and obtain the + * regexes of these types. Typically, these types are 'xsd:simpleType' in the XSD. + */ +class rtTypes +{ +public: + + /** + * @brief the regex map type to store and find the regexes by the associated rtTypeName. + */ + using RegexMapType = std::map< string, Regex >; + + /** + * @brief Custom types are useful to customize the regexes of an existing type. The type name + * can be one of the existing ones, or a totally new one (which can then be used in Wrapper::setRTTypename). + */ + struct CustomTypes + { + /// @cond DO_NOT_DOCUMENT + static constexpr string_view mapPair = "mapPair"; + static constexpr string_view plotLevel = "geos_dataRepository_PlotLevel"; + static constexpr string_view groupName = "groupName"; + static constexpr string_view groupNameRef = "groupNameRef"; + static constexpr string_view groupNameRefArray = "groupNameRef_array"; + /// @endcond + }; + + /** + * @brief Convert a @p std::type_index to a string. + * @param key the std::type_index of the type + * @return a hard coded string that is related to the std::type_index + */ + static string getTypeName( std::type_index const key ); + + /** + * @tparam T type we want the regex + * @return the regex string for the default rtType of T to validate input values to this type. + */ + template< typename T > + static Regex const & getTypeRegex() + { return getTypeRegex< T >( getTypeName( typeid( T ) ) ); } + + /** + * @param typeName The rtType name of the type we want the regex (can be a CustomTypes). + * @tparam T the type we want the regex. If none are available in createBasicTypesRegexMap(), one is + * generated from TypeRegex< T >::get(). + * @return a regex string validating the type T. + */ + template< typename T > + static Regex const & getTypeRegex( string_view typeName ) + { + RegexMapType & map = getTypeRegexMap(); + auto const it = map.find( string( typeName ) ); + if( it != map.end() ) + { + return it->second; + } + else + { + return map.emplace( typeName, TypeRegex< T >::get() ).first->second; + } + } + + /** + * @brief Construct the regexMap for all basic types (TypeRegex< T > extented types are not mentionned) + * @return RegexMapType + */ + static RegexMapType createBasicTypesRegexMap(); + +private: + + /** + * @return A reference to the types regexes map + */ + static RegexMapType & getTypeRegexMap() + { + static RegexMapType m = createBasicTypesRegexMap(); + return m; + } + + /** + * @brief Private constructor because of static class + */ + rtTypes() {} + +}; + +/** + * @brief Utility class for querying type names at runtime. + * @tparam T the target type + * + * This relies on LvArray's demangling facilities and simply + * adds some convenience methods like getting the brief name. + */ +template< typename T > +struct TypeName +{ + /** + * @brief @return Full name of the type. + */ + static string full() + { + return ::LvArray::system::demangle( typeid( T ).name() ); + } + + /** + * @brief @return brief name of the type (ignoring namespaces). + */ + static string brief() + { + string const full_name = full(); + string::size_type const pos = full_name.find_last_of( "::" ); + return ( pos == string::npos ) ? full_name : full_name.substr( pos ); + } +}; + +} + + +#endif /* GEOS_CODINGUTILITIES_RTTYPES_HPP */ diff --git a/src/coreComponents/common/CMakeLists.txt b/src/coreComponents/common/CMakeLists.txt index ae7acd0b611..d3a705ae48a 100644 --- a/src/coreComponents/common/CMakeLists.txt +++ b/src/coreComponents/common/CMakeLists.txt @@ -40,7 +40,6 @@ endif( ) # set( common_sources BufferAllocator.cpp - DataTypes.cpp MemoryInfos.cpp Logger.cpp MpiWrapper.cpp diff --git a/src/coreComponents/common/DataTypes.hpp b/src/coreComponents/common/DataTypes.hpp index f6f19ad383f..7cbab89226c 100644 --- a/src/coreComponents/common/DataTypes.hpp +++ b/src/coreComponents/common/DataTypes.hpp @@ -17,7 +17,7 @@ * @file DataTypes.hpp * * This file contains various aliases and functions that provide operations regarding the - * use of the data types. + * use of the static types. */ #ifndef GEOS_COMMON_DATATYPES_HPP @@ -105,13 +105,6 @@ NEW_TYPE dynamicCast( EXISTING_TYPE & val ) return *ptr; } -/// Global MPI communicator used by GEOSX. -#ifdef GEOS_USE_MPI -extern MPI_Comm MPI_COMM_GEOSX; -#else -extern int MPI_COMM_GEOSX; -#endif - /** * @name Basic data types used in GEOSX. */ @@ -501,200 +494,6 @@ constexpr static auto LOCALINDEX_MAX = std::numeric_limits< localIndex >::max(); /// A global variable for the value of a object that has not been assigned a geos::globalIndex. constexpr static localIndex unmappedLocalIndexValue = -1; - -/** - * @brief Print a short summary of a few select type aliases. - */ -void printTypeSummary(); - -/** - * @brief The regular expression data for validating inputs. Use rtTypes to get the regex of a - * type, and TypeRegex< T > to define a type regex. - */ -struct Regex -{ - /** - * @brief the regular expression string. - */ - string m_regexStr; - /** - * @brief the description of the expected format of the regular expression. - */ - string m_formatDescription; - /** - * @brief Default constructor - */ - Regex() {} - /** - * @param regexStr the regex string for validation (eg. "[\\d]+") - * @param formatDescription the description of the expected format to be validated (eg. "Input value must be an integer."). - */ - Regex( string_view regexStr, string_view formatDescription ); -}; - -/** - * @brief Extension point for custom types to provide a validation regexp to schema. - * Do not use directly to obtain a type regex, rtTypes::getTypeRegex< T >() should be used instead. - * @tparam T the type for which the regex is defined - * @tparam ENABLE used to conditionally enable partial specializations - * - * Specializations should define the following method: - * \code{cpp} - * static string get(); - * \endcode - */ -template< typename T, typename ENABLE = void > -struct TypeRegex -{ - /** - * @brief Get the type's regex (default implementation returns nothing). - * @return The Regex associated with T. - */ - static Regex get() { return {}; } -}; - -/** - * @brief Static class to manage the type selection of types at runtime and obtain the - * regexes of these types. Typically, these types are 'xsd:simpleType' in the XSD. - */ -class rtTypes -{ -public: - - /** - * @brief the regex map type to store and find the regexes by the associated rtTypeName. - */ - using RegexMapType = std::map< string, Regex >; - - /** - * @brief Custom types are useful to customize the regexes of an existing type. The type name - * can be one of the existing ones, or a totally new one (which can then be used in Wrapper::setRTTypename). - */ - struct CustomTypes - { - /// @cond DO_NOT_DOCUMENT - static constexpr string_view mapPair = "mapPair"; - static constexpr string_view plotLevel = "geos_dataRepository_PlotLevel"; - static constexpr string_view groupName = "groupName"; - static constexpr string_view groupNameRef = "groupNameRef"; - static constexpr string_view groupNameRefArray = "groupNameRef_array"; - /// @endcond - }; - - /** - * @brief Convert a @p std::type_index to a string. - * @param key the std::type_index of the type - * @return a hard coded string that is related to the std::type_index - */ - static string getTypeName( std::type_index const key ); - - /** - * @tparam T type we want the regex - * @return the regex string for the default rtType of T to validate input values to this type. - */ - template< typename T > - static Regex const & getTypeRegex() - { return getTypeRegex< T >( getTypeName( typeid( T ) ) ); } - - /** - * @param typeName The rtType name of the type we want the regex (can be a CustomTypes). - * @tparam T the type we want the regex. If none are available in createBasicTypesRegexMap(), one is - * generated from TypeRegex< T >::get(). - * @return a regex string validating the type T. - */ - template< typename T > - static Regex const & getTypeRegex( string_view typeName ) - { - RegexMapType & map = getTypeRegexMap(); - auto const it = map.find( string( typeName ) ); - if( it != map.end() ) - { - return it->second; - } - else - { - return map.emplace( typeName, TypeRegex< T >::get() ).first->second; - } - } - - /** - * @brief Construct the regexMap for all basic types (TypeRegex< T > extented types are not mentionned) - * @return RegexMapType - */ - static RegexMapType createBasicTypesRegexMap(); - -private: - - /** - * @return A reference to the types regexes map - */ - static RegexMapType & getTypeRegexMap() - { - static RegexMapType m = createBasicTypesRegexMap(); - return m; - } - - /** - * @brief Private constructor because of static class - */ - rtTypes() {} - -}; - -/** - * @brief Utility class for querying type names at runtime. - * @tparam T the target type - * - * This relies on LvArray's demangling facilities and simply - * adds some convenience methods like getting the brief name. - */ -template< typename T > -struct TypeName -{ - /** - * @brief @return Full name of the type. - */ - static string full() - { - return ::LvArray::system::demangle( typeid( T ).name() ); - } - - /** - * @brief @return brief name of the type (ignoring namespaces). - */ - static string brief() - { - string const full_name = full(); - string::size_type const pos = full_name.find_last_of( "::" ); - return ( pos == string::npos ) ? full_name : full_name.substr( pos ); - } -}; - -} - -/** - * @brief Format to be able to directly use a std::optional. - * @param T The type of the value contained std::optional and GEOS_FMT_NS::formatter. - */ -template< typename T > -struct GEOS_FMT_NS::formatter< std::optional< T > > : GEOS_FMT_NS::formatter< T > -{ - /** - * @brief Format the std::optional to a string. - * @param opt The std::optional< T > value to format - * @param ctx formatting state consisting of the formatting arguments and the output iterator - * @return return the corresponding value string. If std::optional is empty retun an empty string - */ - auto format( std::optional< T > const & opt, format_context & ctx ) const - { - if( opt ) - { - return GEOS_FMT_NS::formatter< T >::format( *opt, ctx ); - } - return GEOS_FMT_NS::format_to( ctx.out(), "" ); - } -}; - - +} /* namespace geos */ #endif /* GEOS_COMMON_DATATYPES_HPP */ diff --git a/src/coreComponents/common/Format.hpp b/src/coreComponents/common/Format.hpp index 58bf6843c39..d8dcb832cf0 100644 --- a/src/coreComponents/common/Format.hpp +++ b/src/coreComponents/common/Format.hpp @@ -17,6 +17,7 @@ #define GEOS_COMMON_FORMAT_HPP_ #include +#include #if __cplusplus < 202002L #define GEOS_USE_FMT @@ -88,6 +89,36 @@ struct fmt::formatter< T, std::enable_if_t< std::is_enum< T >::value > > */ #define GEOS_FMT_TO( iter, size, msg, ... ) *GEOS_FMT_NS::format_to_n( iter, size - 1, msg, __VA_ARGS__ ).out = '\0' +/** + * @name Custom formatters + */ +///@{ + +/** + * @brief Format to be able to directly use a std::optional. + * @param T The type of the value contained std::optional and GEOS_FMT_NS::formatter. + */ +template< typename T > +struct GEOS_FMT_NS::formatter< std::optional< T > > : GEOS_FMT_NS::formatter< T > +{ + /** + * @brief Format the std::optional to a string. + * @param opt The std::optional< T > value to format + * @param ctx formatting state consisting of the formatting arguments and the output iterator + * @return return the corresponding value string. If std::optional is empty retun an empty string + */ + auto format( std::optional< T > const & opt, format_context & ctx ) const + { + if( opt ) + { + return GEOS_FMT_NS::formatter< T >::format( *opt, ctx ); + } + return GEOS_FMT_NS::format_to( ctx.out(), "" ); + } +}; + +///@} + // The following workaround is needed to fix compilation with NVCC on some PowerPC machines. // The issue causes the following assertion error message: // "Cannot format an argument. To make type T formattable provide a formatter specialization" diff --git a/src/coreComponents/common/MpiWrapper.cpp b/src/coreComponents/common/MpiWrapper.cpp index 521f54fd210..501f86ef5b1 100644 --- a/src/coreComponents/common/MpiWrapper.cpp +++ b/src/coreComponents/common/MpiWrapper.cpp @@ -32,6 +32,12 @@ namespace geos { +#ifdef GEOS_USE_MPI +MPI_Comm MPI_COMM_GEOSX; +#else +int MPI_COMM_GEOSX = 0; +#endif + void MpiWrapper::barrier( MPI_Comm const & MPI_PARAM( comm ) ) { #ifdef GEOS_USE_MPI diff --git a/src/coreComponents/common/MpiWrapper.hpp b/src/coreComponents/common/MpiWrapper.hpp index d0ae08dc1af..cd5a5c21589 100644 --- a/src/coreComponents/common/MpiWrapper.hpp +++ b/src/coreComponents/common/MpiWrapper.hpp @@ -98,6 +98,13 @@ struct MPI_Status namespace geos { +/// Global MPI communicator used by GEOSX. +#ifdef GEOS_USE_MPI +extern MPI_Comm MPI_COMM_GEOSX; +#else +extern int MPI_COMM_GEOSX; +#endif + /** * @struct MpiWrapper * This struct is a wrapper for all mpi.h functions that are used in GEOSX, and provides a collection of diff --git a/src/coreComponents/dataRepository/xmlWrapper.hpp b/src/coreComponents/dataRepository/xmlWrapper.hpp index 04a27502343..5421bfaaedb 100644 --- a/src/coreComponents/dataRepository/xmlWrapper.hpp +++ b/src/coreComponents/dataRepository/xmlWrapper.hpp @@ -27,6 +27,7 @@ #include "LvArray/src/output.hpp" #include "LvArray/src/input.hpp" #include "codingUtilities/StringUtilities.hpp" +#include "codingUtilities/RTTypes.hpp" // TPL includes #include diff --git a/src/coreComponents/fileIO/timeHistory/HDFHistoryIO.hpp b/src/coreComponents/fileIO/timeHistory/HDFHistoryIO.hpp index 6b873f20427..cad4bb72ee7 100644 --- a/src/coreComponents/fileIO/timeHistory/HDFHistoryIO.hpp +++ b/src/coreComponents/fileIO/timeHistory/HDFHistoryIO.hpp @@ -20,6 +20,7 @@ #include "dataRepository/HistoryDataSpec.hpp" #include "BufferedHistoryIO.hpp" #include "common/DataTypes.hpp" +#include "common/MpiWrapper.hpp" #include From 99c20c815d4f9b32a3e6fdd294b62da9e2c41dcf Mon Sep 17 00:00:00 2001 From: MelReyCG Date: Fri, 26 Jul 2024 10:43:12 +0200 Subject: [PATCH 03/24] generated files --- src/coreComponents/schema/docs/ChomboIO.rst | 24 ++++++++++----------- src/coreComponents/schema/schema.xsd | 8 +++---- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/coreComponents/schema/docs/ChomboIO.rst b/src/coreComponents/schema/docs/ChomboIO.rst index 300787a76c2..4bce4a9f5f9 100644 --- a/src/coreComponents/schema/docs/ChomboIO.rst +++ b/src/coreComponents/schema/docs/ChomboIO.rst @@ -1,16 +1,16 @@ -================== ========= =================== =============================================================================================== -Name Type Default Description -================== ========= =================== =============================================================================================== -beginCycle real64 required Cycle at which the coupling will commence. -childDirectory string Child directory path -inputPath string /INVALID_INPUT_PATH Path at which the chombo to geosx file will be written. -name groupName required A name is required for any non-unique nodes -outputPath string required Path at which the geosx to chombo file will be written. -parallelThreads integer 1 Number of plot files. -useChomboPressures integer 0 True iff geosx should use the pressures chombo writes out. -waitForInput integer required True iff geosx should wait for chombo to write out a file. When true the inputPath must be set. -================== ========= =================== =============================================================================================== +================== ========= =================== ============================================================================================== +Name Type Default Description +================== ========= =================== ============================================================================================== +beginCycle real64 required Cycle at which the coupling will commence. +childDirectory string Child directory path +inputPath string /INVALID_INPUT_PATH Path at which the chombo to geos file will be written. +name groupName required A name is required for any non-unique nodes +outputPath string required Path at which the geos to chombo file will be written. +parallelThreads integer 1 Number of plot files. +useChomboPressures integer 0 True iff geos should use the pressures chombo writes out. +waitForInput integer required True iff geos should wait for chombo to write out a file. When true the inputPath must be set. +================== ========= =================== ============================================================================================== diff --git a/src/coreComponents/schema/schema.xsd b/src/coreComponents/schema/schema.xsd index ecbf7a1b217..52e7878e80d 100644 --- a/src/coreComponents/schema/schema.xsd +++ b/src/coreComponents/schema/schema.xsd @@ -2033,15 +2033,15 @@ the relative residual norm satisfies: - + - + - + - + From 008f8e8975ba3a2013f5214b2c53be7ff594a11a Mon Sep 17 00:00:00 2001 From: MelReyCG Date: Fri, 26 Jul 2024 12:08:31 +0200 Subject: [PATCH 04/24] sharper todos --- src/coreComponents/common/CMakeLists.txt | 9 ++++++--- src/coreComponents/common/DataTypes.hpp | 1 - src/coreComponents/common/FieldSpecificationOps.hpp | 2 +- src/coreComponents/common/Logger.cpp | 2 +- src/coreComponents/common/MultiMutexesLock.hpp | 2 +- src/coreComponents/common/Span.hpp | 2 +- src/coreComponents/common/initializeEnvironment.cpp | 6 +++--- 7 files changed, 13 insertions(+), 11 deletions(-) diff --git a/src/coreComponents/common/CMakeLists.txt b/src/coreComponents/common/CMakeLists.txt index d3a705ae48a..5b8bc3fa1f4 100644 --- a/src/coreComponents/common/CMakeLists.txt +++ b/src/coreComponents/common/CMakeLists.txt @@ -94,9 +94,12 @@ if( ENABLE_CALIPER ) endif() endif() - # TODO: remove codingUtilities (move StringUtilities in common) - # remove fileIO (move "Table/*" into a "format/table/*" package) - # add basicIO/* and put Logger in it + # TODO F.C.Cu refactor: remove codingUtilities + # - move StringUtilities in common/format/* + # remove fileIO/* + # - move "Table/*" in common/format/table + # - move Logger.xpp in basicIO/logger/* + # - move hdf5Interface in basicIO/* set( dependencyList ${dependencyList} fileIO codingUtilities ) blt_add_library( NAME common diff --git a/src/coreComponents/common/DataTypes.hpp b/src/coreComponents/common/DataTypes.hpp index 7cbab89226c..92ef07fe801 100644 --- a/src/coreComponents/common/DataTypes.hpp +++ b/src/coreComponents/common/DataTypes.hpp @@ -29,7 +29,6 @@ #include "BufferAllocator.hpp" #include "DataLayouts.hpp" #include "Tensor.hpp" -#include "Logger.hpp" #include "LvArray/src/Macros.hpp" #include "LvArray/src/Array.hpp" #include "LvArray/src/ArrayOfArrays.hpp" diff --git a/src/coreComponents/common/FieldSpecificationOps.hpp b/src/coreComponents/common/FieldSpecificationOps.hpp index 4acd27b6fd6..aaa1d24db7a 100644 --- a/src/coreComponents/common/FieldSpecificationOps.hpp +++ b/src/coreComponents/common/FieldSpecificationOps.hpp @@ -20,7 +20,7 @@ #ifndef GEOS_COMMON_FIELDSPECIFICATIONOPS_HPP #define GEOS_COMMON_FIELDSPECIFICATIONOPS_HPP -#include "codingUtilities/traits.hpp" // why? what can we do about it? can we just ignore it for now? +#include "codingUtilities/traits.hpp" // TODO F.C.Cu refactor: why? what can we do about it? can we just ignore it for now? #include "common/DataTypes.hpp" #include "common/GEOS_RAJA_Interface.hpp" diff --git a/src/coreComponents/common/Logger.cpp b/src/coreComponents/common/Logger.cpp index b893007a2de..98a63d7b153 100644 --- a/src/coreComponents/common/Logger.cpp +++ b/src/coreComponents/common/Logger.cpp @@ -20,7 +20,7 @@ // Source includes #include "Logger.hpp" #include "Path.hpp" -#include "codingUtilities/StringUtilities.hpp" // TODO: -> format/ +#include "codingUtilities/StringUtilities.hpp" // TODO F.C.Cu refactor: -> format/ namespace geos { diff --git a/src/coreComponents/common/MultiMutexesLock.hpp b/src/coreComponents/common/MultiMutexesLock.hpp index 50444972a32..5f505c9c85c 100644 --- a/src/coreComponents/common/MultiMutexesLock.hpp +++ b/src/coreComponents/common/MultiMutexesLock.hpp @@ -19,7 +19,7 @@ #include #include -#include "codingUtilities/Utilities.hpp" // TODO: -> common/ +#include "codingUtilities/Utilities.hpp" // TODO F.C.Cu refactor: -> common/ namespace geos { diff --git a/src/coreComponents/common/Span.hpp b/src/coreComponents/common/Span.hpp index cc6ec8fb340..ca83dacc4db 100644 --- a/src/coreComponents/common/Span.hpp +++ b/src/coreComponents/common/Span.hpp @@ -20,7 +20,7 @@ #ifndef GEOS_COMMON_SPAN_HPP #define GEOS_COMMON_SPAN_HPP -#include "codingUtilities/traits.hpp" // TODO: why? what can we do about it? can we just ignore it for now? +#include "codingUtilities/traits.hpp" // TODO F.C.Cu refactor: why? what can we do about it? can we just ignore it for now? #include "common/Logger.hpp" #include diff --git a/src/coreComponents/common/initializeEnvironment.cpp b/src/coreComponents/common/initializeEnvironment.cpp index 15a1b78839b..9b207d6ba25 100644 --- a/src/coreComponents/common/initializeEnvironment.cpp +++ b/src/coreComponents/common/initializeEnvironment.cpp @@ -18,9 +18,9 @@ #include "TimingMacros.hpp" #include "Path.hpp" #include "LvArray/src/system.hpp" -#include "fileIO/Table/TableLayout.hpp" // TODO: -> basicIO/ -#include "fileIO/Table/TableData.hpp" // TODO: -> basicIO/ -#include "fileIO/Table/TableFormatter.hpp" // TODO: -> basicIO/ +#include "fileIO/Table/TableLayout.hpp" // TODO F.C.Cu refactor: -> basicIO/ +#include "fileIO/Table/TableData.hpp" // TODO F.C.Cu refactor: -> basicIO/ +#include "fileIO/Table/TableFormatter.hpp" // TODO F.C.Cu refactor: -> basicIO/ #include "common/LifoStorageCommon.hpp" #include "common/MemoryInfos.hpp" #include From 56a4db2113fdb83621da17daebbd2eb1fc061ccc Mon Sep 17 00:00:00 2001 From: MelReyCG Date: Fri, 26 Jul 2024 14:08:09 +0200 Subject: [PATCH 05/24] more todo --- src/coreComponents/codingUtilities/CMakeLists.txt | 2 ++ src/coreComponents/common/DataTypes.hpp | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/coreComponents/codingUtilities/CMakeLists.txt b/src/coreComponents/codingUtilities/CMakeLists.txt index 29d137ba925..9c22cda7feb 100644 --- a/src/coreComponents/codingUtilities/CMakeLists.txt +++ b/src/coreComponents/codingUtilities/CMakeLists.txt @@ -10,6 +10,7 @@ set( codingUtilities_headers UnitTestUtilities.hpp Utilities.hpp traits.hpp + # TODO F.C.Cu refactor: add xmlWrapper.hpp ) # @@ -19,6 +20,7 @@ set( codingUtilities_sources Parsing.cpp RTTypes.cpp StringUtilities.cpp + # TODO F.C.Cu refactor: add xmlWrapper.cpp ) set( dependencyList ${parallelDeps} common fast_float ) diff --git a/src/coreComponents/common/DataTypes.hpp b/src/coreComponents/common/DataTypes.hpp index 92ef07fe801..47fbe4e1cc3 100644 --- a/src/coreComponents/common/DataTypes.hpp +++ b/src/coreComponents/common/DataTypes.hpp @@ -29,6 +29,7 @@ #include "BufferAllocator.hpp" #include "DataLayouts.hpp" #include "Tensor.hpp" +#include "Logger.hpp" // TODO F.C.Cu refactor: remove from here as it is not static type related and call it from higher level files #include "LvArray/src/Macros.hpp" #include "LvArray/src/Array.hpp" #include "LvArray/src/ArrayOfArrays.hpp" @@ -78,7 +79,7 @@ namespace geos * @return pointer cast to derived type or @p nullptr */ template< typename NEW_TYPE, typename EXISTING_TYPE > -NEW_TYPE dynamicCast( EXISTING_TYPE * const val ) +NEW_TYPE dynamicCast( EXISTING_TYPE * const val ) // TODO F.C.Cu refactor: try to move that in RTTypes.hpp { static_assert( std::is_pointer< NEW_TYPE >::value, "NEW_TYPE must be a pointer." ); return dynamic_cast< NEW_TYPE >( val ); @@ -92,7 +93,7 @@ NEW_TYPE dynamicCast( EXISTING_TYPE * const val ) * @return reference cast to derived type or @p nullptr */ template< typename NEW_TYPE, typename EXISTING_TYPE > -NEW_TYPE dynamicCast( EXISTING_TYPE & val ) +NEW_TYPE dynamicCast( EXISTING_TYPE & val ) // TODO F.C.Cu refactor: try to move that in RTTypes.hpp { static_assert( std::is_reference< NEW_TYPE >::value, "NEW_TYPE must be a reference." ); From fb447b83cf94fe9298ece6b5809962772470b187 Mon Sep 17 00:00:00 2001 From: MelReyCG Date: Fri, 26 Jul 2024 15:38:21 +0200 Subject: [PATCH 06/24] removing common -> fileIO --- .../codingUtilities/EnumStrings.hpp | 2 +- src/coreComponents/common/CMakeLists.txt | 16 +++++++++++----- src/coreComponents/common/Logger.hpp | 2 +- .../common/{ => format}/Format.hpp | 0 .../Table => common/format/table}/TableData.cpp | 0 .../Table => common/format/table}/TableData.hpp | 2 +- .../format/table}/TableFormatter.cpp | 0 .../format/table}/TableFormatter.hpp | 0 .../format/table}/TableLayout.cpp | 0 .../format/table}/TableLayout.hpp | 0 .../format/table}/unitTests/CMakeLists.txt | 0 .../format/table}/unitTests/testTable.cpp | 6 +++--- .../common/initializeEnvironment.cpp | 4 +--- .../dataRepository/DataContext.hpp | 2 +- src/coreComponents/events/PeriodicEvent.cpp | 2 +- src/coreComponents/fileIO/CMakeLists.txt | 9 --------- .../mesh/generators/VTKMeshGeneratorTools.hpp | 2 +- .../mesh/generators/WellGeneratorBase.cpp | 6 ++---- .../physicsSolvers/LinearSolverParameters.cpp | 2 +- .../physicsSolvers/NonlinearSolverParameters.cpp | 2 +- src/main/main.cpp | 2 +- 21 files changed, 26 insertions(+), 33 deletions(-) rename src/coreComponents/common/{ => format}/Format.hpp (100%) rename src/coreComponents/{fileIO/Table => common/format/table}/TableData.cpp (100%) rename src/coreComponents/{fileIO/Table => common/format/table}/TableData.hpp (99%) rename src/coreComponents/{fileIO/Table => common/format/table}/TableFormatter.cpp (100%) rename src/coreComponents/{fileIO/Table => common/format/table}/TableFormatter.hpp (100%) rename src/coreComponents/{fileIO/Table => common/format/table}/TableLayout.cpp (100%) rename src/coreComponents/{fileIO/Table => common/format/table}/TableLayout.hpp (100%) rename src/coreComponents/{fileIO/Table => common/format/table}/unitTests/CMakeLists.txt (100%) rename src/coreComponents/{fileIO/Table => common/format/table}/unitTests/testTable.cpp (99%) diff --git a/src/coreComponents/codingUtilities/EnumStrings.hpp b/src/coreComponents/codingUtilities/EnumStrings.hpp index 449bf4790b7..a7dfca6a775 100644 --- a/src/coreComponents/codingUtilities/EnumStrings.hpp +++ b/src/coreComponents/codingUtilities/EnumStrings.hpp @@ -29,7 +29,7 @@ #include "codingUtilities/RTTypes.hpp" #include "common/DataTypes.hpp" #include "common/Logger.hpp" -#include "common/Format.hpp" +#include "common/format/Format.hpp" #include #include diff --git a/src/coreComponents/common/CMakeLists.txt b/src/coreComponents/common/CMakeLists.txt index 5b8bc3fa1f4..8667e94c088 100644 --- a/src/coreComponents/common/CMakeLists.txt +++ b/src/coreComponents/common/CMakeLists.txt @@ -3,15 +3,18 @@ # set( common_headers ${CMAKE_BINARY_DIR}/include/common/GeosxConfig.hpp + Logger.hpp # TODO F.C.Cu refactor: logger/Logger.hpp + format/Format.hpp + format/table/TableLayout.hpp + format/table/TableFormatter.hpp + format/table/TableData.hpp BufferAllocator.hpp DataLayouts.hpp DataTypes.hpp FieldSpecificationOps.hpp - Format.hpp GEOS_RAJA_Interface.hpp GeosxMacros.hpp MemoryInfos.hpp - Logger.hpp MpiWrapper.hpp Path.hpp Span.hpp @@ -39,9 +42,12 @@ endif( ) # Specify all sources # set( common_sources + Logger.cpp # TODO F.C.Cu refactor: logger/Logger.cpp + format/table/TableLayout.cpp + format/table/TableFormatter.cpp + format/table/TableData.cpp BufferAllocator.cpp MemoryInfos.cpp - Logger.cpp MpiWrapper.cpp Path.cpp initializeEnvironment.cpp @@ -97,10 +103,9 @@ endif() # TODO F.C.Cu refactor: remove codingUtilities # - move StringUtilities in common/format/* # remove fileIO/* - # - move "Table/*" in common/format/table # - move Logger.xpp in basicIO/logger/* # - move hdf5Interface in basicIO/* -set( dependencyList ${dependencyList} fileIO codingUtilities ) +set( dependencyList ${dependencyList} codingUtilities ) blt_add_library( NAME common SOURCES ${common_sources} @@ -114,4 +119,5 @@ target_include_directories( common PUBLIC ${CMAKE_SOURCE_DIR}/coreComponents ) if( GEOS_ENABLE_TESTS ) add_subdirectory( unitTests ) + add_subdirectory( format/table/unitTests ) endif() diff --git a/src/coreComponents/common/Logger.hpp b/src/coreComponents/common/Logger.hpp index 7246173f496..6fc3619f538 100644 --- a/src/coreComponents/common/Logger.hpp +++ b/src/coreComponents/common/Logger.hpp @@ -23,7 +23,7 @@ // Source incldes #include "common/GeosxConfig.hpp" #include "common/GeosxMacros.hpp" -#include "common/Format.hpp" +#include "common/format/Format.hpp" #include "LvArray/src/Macros.hpp" // System includes diff --git a/src/coreComponents/common/Format.hpp b/src/coreComponents/common/format/Format.hpp similarity index 100% rename from src/coreComponents/common/Format.hpp rename to src/coreComponents/common/format/Format.hpp diff --git a/src/coreComponents/fileIO/Table/TableData.cpp b/src/coreComponents/common/format/table/TableData.cpp similarity index 100% rename from src/coreComponents/fileIO/Table/TableData.cpp rename to src/coreComponents/common/format/table/TableData.cpp diff --git a/src/coreComponents/fileIO/Table/TableData.hpp b/src/coreComponents/common/format/table/TableData.hpp similarity index 99% rename from src/coreComponents/fileIO/Table/TableData.hpp rename to src/coreComponents/common/format/table/TableData.hpp index 67ce37cafb3..9cf2ebdd5dd 100644 --- a/src/coreComponents/fileIO/Table/TableData.hpp +++ b/src/coreComponents/common/format/table/TableData.hpp @@ -21,7 +21,7 @@ #define GEOS_COMMON_TableData_HPP #include "common/DataTypes.hpp" -#include "common/Format.hpp" +#include "common/format/Format.hpp" namespace geos { diff --git a/src/coreComponents/fileIO/Table/TableFormatter.cpp b/src/coreComponents/common/format/table/TableFormatter.cpp similarity index 100% rename from src/coreComponents/fileIO/Table/TableFormatter.cpp rename to src/coreComponents/common/format/table/TableFormatter.cpp diff --git a/src/coreComponents/fileIO/Table/TableFormatter.hpp b/src/coreComponents/common/format/table/TableFormatter.hpp similarity index 100% rename from src/coreComponents/fileIO/Table/TableFormatter.hpp rename to src/coreComponents/common/format/table/TableFormatter.hpp diff --git a/src/coreComponents/fileIO/Table/TableLayout.cpp b/src/coreComponents/common/format/table/TableLayout.cpp similarity index 100% rename from src/coreComponents/fileIO/Table/TableLayout.cpp rename to src/coreComponents/common/format/table/TableLayout.cpp diff --git a/src/coreComponents/fileIO/Table/TableLayout.hpp b/src/coreComponents/common/format/table/TableLayout.hpp similarity index 100% rename from src/coreComponents/fileIO/Table/TableLayout.hpp rename to src/coreComponents/common/format/table/TableLayout.hpp diff --git a/src/coreComponents/fileIO/Table/unitTests/CMakeLists.txt b/src/coreComponents/common/format/table/unitTests/CMakeLists.txt similarity index 100% rename from src/coreComponents/fileIO/Table/unitTests/CMakeLists.txt rename to src/coreComponents/common/format/table/unitTests/CMakeLists.txt diff --git a/src/coreComponents/fileIO/Table/unitTests/testTable.cpp b/src/coreComponents/common/format/table/unitTests/testTable.cpp similarity index 99% rename from src/coreComponents/fileIO/Table/unitTests/testTable.cpp rename to src/coreComponents/common/format/table/unitTests/testTable.cpp index 0a5f0194680..37c78d01db6 100644 --- a/src/coreComponents/fileIO/Table/unitTests/testTable.cpp +++ b/src/coreComponents/common/format/table/unitTests/testTable.cpp @@ -14,9 +14,9 @@ */ // Source includes -#include "fileIO/Table/TableData.hpp" -#include "fileIO/Table/TableFormatter.hpp" -#include "fileIO/Table/TableLayout.hpp" +#include "common/format/table/TableData.hpp" +#include "common/format/table/TableFormatter.hpp" +#include "common/format/table/TableLayout.hpp" #include "dataRepository/Group.hpp" // TPL includes #include diff --git a/src/coreComponents/common/initializeEnvironment.cpp b/src/coreComponents/common/initializeEnvironment.cpp index 9b207d6ba25..f544c5aa8d5 100644 --- a/src/coreComponents/common/initializeEnvironment.cpp +++ b/src/coreComponents/common/initializeEnvironment.cpp @@ -18,9 +18,7 @@ #include "TimingMacros.hpp" #include "Path.hpp" #include "LvArray/src/system.hpp" -#include "fileIO/Table/TableLayout.hpp" // TODO F.C.Cu refactor: -> basicIO/ -#include "fileIO/Table/TableData.hpp" // TODO F.C.Cu refactor: -> basicIO/ -#include "fileIO/Table/TableFormatter.hpp" // TODO F.C.Cu refactor: -> basicIO/ +#include "common/format/table/TableFormatter.hpp" #include "common/LifoStorageCommon.hpp" #include "common/MemoryInfos.hpp" #include diff --git a/src/coreComponents/dataRepository/DataContext.hpp b/src/coreComponents/dataRepository/DataContext.hpp index 99893bc77f7..06190b33732 100644 --- a/src/coreComponents/dataRepository/DataContext.hpp +++ b/src/coreComponents/dataRepository/DataContext.hpp @@ -23,7 +23,7 @@ #include "common/DataTypes.hpp" #include "common/Logger.hpp" #include "xmlWrapper.hpp" -#include "common/Format.hpp" +#include "common/format/Format.hpp" namespace geos { diff --git a/src/coreComponents/events/PeriodicEvent.cpp b/src/coreComponents/events/PeriodicEvent.cpp index 2ead548c7aa..88d24228199 100644 --- a/src/coreComponents/events/PeriodicEvent.cpp +++ b/src/coreComponents/events/PeriodicEvent.cpp @@ -19,7 +19,7 @@ #include "PeriodicEvent.hpp" -#include "common/Format.hpp" +#include "common/format/Format.hpp" #include "functions/FunctionManager.hpp" namespace geos diff --git a/src/coreComponents/fileIO/CMakeLists.txt b/src/coreComponents/fileIO/CMakeLists.txt index 41467c67358..84c758fa2b2 100644 --- a/src/coreComponents/fileIO/CMakeLists.txt +++ b/src/coreComponents/fileIO/CMakeLists.txt @@ -6,9 +6,6 @@ set( fileIO_headers Outputs/OutputUtilities.hpp Outputs/PythonOutput.hpp Outputs/RestartOutput.hpp - Table/TableLayout.hpp - Table/TableFormatter.hpp - Table/TableData.hpp Outputs/TimeHistoryOutput.hpp timeHistory/HDFFile.hpp timeHistory/HistoryCollectionBase.hpp @@ -25,9 +22,6 @@ set( fileIO_sources Outputs/OutputUtilities.cpp Outputs/PythonOutput.cpp Outputs/RestartOutput.cpp - Table/TableLayout.cpp - Table/TableFormatter.cpp - Table/TableData.cpp Outputs/TimeHistoryOutput.cpp timeHistory/HDFFile.cpp timeHistory/HistoryCollectionBase.cpp @@ -94,9 +88,6 @@ blt_add_library( NAME fileIO target_include_directories( fileIO PUBLIC ${CMAKE_SOURCE_DIR}/coreComponents ) -if( GEOS_ENABLE_TESTS ) - add_subdirectory( Table/unitTests ) -endif() diff --git a/src/coreComponents/mesh/generators/VTKMeshGeneratorTools.hpp b/src/coreComponents/mesh/generators/VTKMeshGeneratorTools.hpp index 8d368dd0d67..d38d25db874 100644 --- a/src/coreComponents/mesh/generators/VTKMeshGeneratorTools.hpp +++ b/src/coreComponents/mesh/generators/VTKMeshGeneratorTools.hpp @@ -27,7 +27,7 @@ #include // NOTE: do NOT include anything from GEOS here. -// In particular, nothing that directly or transitively includes "common/Format.hpp". +// In particular, nothing that directly or transitively includes "common/format/Format.hpp". // The reason is "diy2" library includes an older version of {fmt} than the one used by GEOS. // Collision of includes leads to all kinds of impossible to fix compilation errors. // Thankfully, no link errors, owing to namespace versioning employed by {fmt}. diff --git a/src/coreComponents/mesh/generators/WellGeneratorBase.cpp b/src/coreComponents/mesh/generators/WellGeneratorBase.cpp index 55613fc29a2..28cdef1135b 100644 --- a/src/coreComponents/mesh/generators/WellGeneratorBase.cpp +++ b/src/coreComponents/mesh/generators/WellGeneratorBase.cpp @@ -18,10 +18,8 @@ #include "mesh/Perforation.hpp" #include "mesh/generators/LineBlockABC.hpp" #include "LvArray/src/genericTensorOps.hpp" -#include "fileIO/Table/TableLayout.hpp" -#include "fileIO/Table/TableData.hpp" -#include "fileIO/Table/TableFormatter.hpp" -#include "common/Format.hpp" +#include "common/format/table/TableFormatter.hpp" +#include "common/format/Format.hpp" namespace geos { using namespace dataRepository; diff --git a/src/coreComponents/physicsSolvers/LinearSolverParameters.cpp b/src/coreComponents/physicsSolvers/LinearSolverParameters.cpp index 61895d45695..153703c0eb0 100644 --- a/src/coreComponents/physicsSolvers/LinearSolverParameters.cpp +++ b/src/coreComponents/physicsSolvers/LinearSolverParameters.cpp @@ -18,7 +18,7 @@ */ #include "LinearSolverParameters.hpp" -#include "fileIO/Table/TableFormatter.hpp" +#include "common/format/table/TableFormatter.hpp" namespace geos { diff --git a/src/coreComponents/physicsSolvers/NonlinearSolverParameters.cpp b/src/coreComponents/physicsSolvers/NonlinearSolverParameters.cpp index b7878d79081..fae9f3c8236 100644 --- a/src/coreComponents/physicsSolvers/NonlinearSolverParameters.cpp +++ b/src/coreComponents/physicsSolvers/NonlinearSolverParameters.cpp @@ -15,7 +15,7 @@ #include "NonlinearSolverParameters.hpp" #include "common/Logger.hpp" -#include "fileIO/Table/TableFormatter.hpp" +#include "common/format/table/TableFormatter.hpp" namespace geos { diff --git a/src/main/main.cpp b/src/main/main.cpp index 731496fb5b0..375b456aadf 100644 --- a/src/main/main.cpp +++ b/src/main/main.cpp @@ -15,7 +15,7 @@ // Source includes #include "common/DataTypes.hpp" -#include "common/Format.hpp" +#include "common/format/Format.hpp" #include "common/TimingMacros.hpp" #include "common/Units.hpp" #include "mainInterface/initialization.hpp" From 78afee28f151b707d156c22fd251279d922b285f Mon Sep 17 00:00:00 2001 From: MelReyCG Date: Fri, 26 Jul 2024 16:03:51 +0200 Subject: [PATCH 07/24] last common->fileIO ref --- src/coreComponents/common/format/table/TableData.hpp | 6 +++--- src/coreComponents/common/format/table/TableFormatter.hpp | 6 +++--- src/coreComponents/common/format/table/TableLayout.hpp | 6 +++--- .../common/format/table/unitTests/CMakeLists.txt | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/coreComponents/common/format/table/TableData.hpp b/src/coreComponents/common/format/table/TableData.hpp index 9cf2ebdd5dd..005e3dda7bc 100644 --- a/src/coreComponents/common/format/table/TableData.hpp +++ b/src/coreComponents/common/format/table/TableData.hpp @@ -17,8 +17,8 @@ * @file TableData.hpp */ -#ifndef GEOS_COMMON_TableData_HPP -#define GEOS_COMMON_TableData_HPP +#ifndef GEOS_COMMON_FORMAT_TABLE_TABLEDATA_HPP +#define GEOS_COMMON_FORMAT_TABLE_TABLEDATA_HPP #include "common/DataTypes.hpp" #include "common/format/Format.hpp" @@ -144,4 +144,4 @@ void TableData2D::addCell( real64 const rowValue, real64 const columnValue, T co } } -#endif +#endif /* GEOS_COMMON_FORMAT_TABLE_TABLEDATA_HPP */ diff --git a/src/coreComponents/common/format/table/TableFormatter.hpp b/src/coreComponents/common/format/table/TableFormatter.hpp index b06a136e687..21ddc8c5b11 100644 --- a/src/coreComponents/common/format/table/TableFormatter.hpp +++ b/src/coreComponents/common/format/table/TableFormatter.hpp @@ -17,8 +17,8 @@ * @file TableFormatter.hpp */ -#ifndef GEOS_COMMON_TABLEFORMATTER_HPP -#define GEOS_COMMON_TABLEFORMATTER_HPP +#ifndef GEOS_COMMON_FORMAT_TABLE_TABLEFORMATTER_HPP +#define GEOS_COMMON_FORMAT_TABLE_TABLEFORMATTER_HPP #include "TableData.hpp" #include "TableLayout.hpp" @@ -219,4 +219,4 @@ class TableTextFormatter : public TableFormatter }; } -#endif +#endif /* GEOS_COMMON_FORMAT_TABLE_TABLEFORMATTER_HPP */ diff --git a/src/coreComponents/common/format/table/TableLayout.hpp b/src/coreComponents/common/format/table/TableLayout.hpp index 9c45c727b22..1c4608e3ea5 100644 --- a/src/coreComponents/common/format/table/TableLayout.hpp +++ b/src/coreComponents/common/format/table/TableLayout.hpp @@ -17,8 +17,8 @@ * @file TableLayout.hpp */ -#ifndef GEOS_COMMON_TABLELAYOUT_HPP -#define GEOS_COMMON_TABLELAYOUT_HPP +#ifndef GEOS_COMMON_FORMAT_TABLE_TABLELAYOUT_HPP +#define GEOS_COMMON_FORMAT_TABLE_TABLELAYOUT_HPP #include "common/DataTypes.hpp" @@ -154,4 +154,4 @@ class TableLayout }; } -#endif +#endif /* GEOS_COMMON_FORMAT_TABLE_TABLELAYOUT_HPP */ diff --git a/src/coreComponents/common/format/table/unitTests/CMakeLists.txt b/src/coreComponents/common/format/table/unitTests/CMakeLists.txt index 4db71486656..f5a4a358e97 100644 --- a/src/coreComponents/common/format/table/unitTests/CMakeLists.txt +++ b/src/coreComponents/common/format/table/unitTests/CMakeLists.txt @@ -2,7 +2,7 @@ set( gtest_geosx_tests testTable.cpp ) -set( dependencyList gtest fileIO ${parallelDeps} ) +set( dependencyList gtest common ${parallelDeps} ) # Add gtest C++ based tests foreach(test ${gtest_geosx_tests}) From 675f6a61c6ab0a711a54dbfbfc036573e73fdf00 Mon Sep 17 00:00:00 2001 From: MelReyCG Date: Fri, 26 Jul 2024 16:41:59 +0200 Subject: [PATCH 08/24] removing common->codingUtilities --- .../codingUtilities/CMakeLists.txt | 2 -- .../codingUtilities/EnumStrings.hpp | 2 +- .../codingUtilities/RTTypes.cpp | 2 +- .../codingUtilities/Utilities.hpp | 2 +- .../codingUtilities/tests/CMakeLists.txt | 1 - src/coreComponents/common/CMakeLists.txt | 9 +++++---- src/coreComponents/common/Logger.cpp | 2 +- .../format}/StringUtilities.cpp | 0 .../format}/StringUtilities.hpp | 6 +++--- .../common/format/table/TableFormatter.cpp | 2 +- .../common/format/unitTests/CMakeLists.txt | 19 +++++++++++++++++++ .../format/unitTests}/testStringUtilities.cpp | 0 .../CO2Brine/functions/PVTFunctionHelpers.hpp | 2 +- .../fluid/multifluid/PVTDriver.cpp | 2 +- src/coreComponents/dataRepository/Group.cpp | 2 +- .../dataRepository/ObjectCatalog.hpp | 2 +- .../dataRepository/xmlWrapper.cpp | 2 +- .../dataRepository/xmlWrapper.hpp | 2 +- .../FieldSpecificationManager.cpp | 2 +- .../FieldSpecificationManager.hpp | 2 +- .../mainInterface/ProblemManager.cpp | 2 +- src/coreComponents/mesh/FieldIdentifiers.hpp | 2 +- .../SimpleGeometricObjectBase.hpp | 2 +- src/coreComponents/schema/schemaUtilities.cpp | 2 +- 24 files changed, 44 insertions(+), 27 deletions(-) rename src/coreComponents/{codingUtilities => common/format}/StringUtilities.cpp (100%) rename src/coreComponents/{codingUtilities => common/format}/StringUtilities.hpp (98%) create mode 100644 src/coreComponents/common/format/unitTests/CMakeLists.txt rename src/coreComponents/{codingUtilities/tests => common/format/unitTests}/testStringUtilities.cpp (100%) diff --git a/src/coreComponents/codingUtilities/CMakeLists.txt b/src/coreComponents/codingUtilities/CMakeLists.txt index 9c22cda7feb..3740557b2cf 100644 --- a/src/coreComponents/codingUtilities/CMakeLists.txt +++ b/src/coreComponents/codingUtilities/CMakeLists.txt @@ -6,7 +6,6 @@ set( codingUtilities_headers RTTypes.hpp Parsing.hpp SFINAE_Macros.hpp - StringUtilities.hpp UnitTestUtilities.hpp Utilities.hpp traits.hpp @@ -19,7 +18,6 @@ set( codingUtilities_headers set( codingUtilities_sources Parsing.cpp RTTypes.cpp - StringUtilities.cpp # TODO F.C.Cu refactor: add xmlWrapper.cpp ) diff --git a/src/coreComponents/codingUtilities/EnumStrings.hpp b/src/coreComponents/codingUtilities/EnumStrings.hpp index a7dfca6a775..1a17b2c9970 100644 --- a/src/coreComponents/codingUtilities/EnumStrings.hpp +++ b/src/coreComponents/codingUtilities/EnumStrings.hpp @@ -25,7 +25,7 @@ #ifndef GEOS_CODINGUTILITIES_ENUMSTRINGS_HPP #define GEOS_CODINGUTILITIES_ENUMSTRINGS_HPP -#include "codingUtilities/StringUtilities.hpp" +#include "common/format/StringUtilities.hpp" #include "codingUtilities/RTTypes.hpp" #include "common/DataTypes.hpp" #include "common/Logger.hpp" diff --git a/src/coreComponents/codingUtilities/RTTypes.cpp b/src/coreComponents/codingUtilities/RTTypes.cpp index 486db14e52a..52d51964af1 100644 --- a/src/coreComponents/codingUtilities/RTTypes.cpp +++ b/src/coreComponents/codingUtilities/RTTypes.cpp @@ -20,7 +20,7 @@ #include "RTTypes.hpp" #include "LvArray/src/system.hpp" -#include "codingUtilities/StringUtilities.hpp" +#include "common/format/StringUtilities.hpp" namespace geos { diff --git a/src/coreComponents/codingUtilities/Utilities.hpp b/src/coreComponents/codingUtilities/Utilities.hpp index 3c4d79ec2ae..a8192c7052e 100644 --- a/src/coreComponents/codingUtilities/Utilities.hpp +++ b/src/coreComponents/codingUtilities/Utilities.hpp @@ -20,7 +20,7 @@ #ifndef GEOS_CODINGUTILITIES_UTILITIES_H_ #define GEOS_CODINGUTILITIES_UTILITIES_H_ -#include "codingUtilities/StringUtilities.hpp" +#include "common/format/StringUtilities.hpp" #include "common/DataTypes.hpp" #include "LvArray/src/limits.hpp" #include "common/GEOS_RAJA_Interface.hpp" diff --git a/src/coreComponents/codingUtilities/tests/CMakeLists.txt b/src/coreComponents/codingUtilities/tests/CMakeLists.txt index 85042471be1..33f4168e86e 100644 --- a/src/coreComponents/codingUtilities/tests/CMakeLists.txt +++ b/src/coreComponents/codingUtilities/tests/CMakeLists.txt @@ -1,7 +1,6 @@ # Specify list of tests set( testSources testGeosxTraits.cpp - testStringUtilities.cpp testParsing.cpp testUtilities.cpp ) diff --git a/src/coreComponents/common/CMakeLists.txt b/src/coreComponents/common/CMakeLists.txt index 8667e94c088..bb9d3fec1fe 100644 --- a/src/coreComponents/common/CMakeLists.txt +++ b/src/coreComponents/common/CMakeLists.txt @@ -4,10 +4,11 @@ set( common_headers ${CMAKE_BINARY_DIR}/include/common/GeosxConfig.hpp Logger.hpp # TODO F.C.Cu refactor: logger/Logger.hpp - format/Format.hpp format/table/TableLayout.hpp format/table/TableFormatter.hpp format/table/TableData.hpp + format/Format.hpp + format/StringUtilities.hpp BufferAllocator.hpp DataLayouts.hpp DataTypes.hpp @@ -46,6 +47,7 @@ set( common_sources format/table/TableLayout.cpp format/table/TableFormatter.cpp format/table/TableData.cpp + format/StringUtilities.cpp BufferAllocator.cpp MemoryInfos.cpp MpiWrapper.cpp @@ -101,11 +103,9 @@ if( ENABLE_CALIPER ) endif() # TODO F.C.Cu refactor: remove codingUtilities - # - move StringUtilities in common/format/* - # remove fileIO/* # - move Logger.xpp in basicIO/logger/* # - move hdf5Interface in basicIO/* -set( dependencyList ${dependencyList} codingUtilities ) +set( dependencyList ${dependencyList} ) blt_add_library( NAME common SOURCES ${common_sources} @@ -120,4 +120,5 @@ target_include_directories( common PUBLIC ${CMAKE_SOURCE_DIR}/coreComponents ) if( GEOS_ENABLE_TESTS ) add_subdirectory( unitTests ) add_subdirectory( format/table/unitTests ) + add_subdirectory( format/unitTests ) endif() diff --git a/src/coreComponents/common/Logger.cpp b/src/coreComponents/common/Logger.cpp index 98a63d7b153..e0c99136171 100644 --- a/src/coreComponents/common/Logger.cpp +++ b/src/coreComponents/common/Logger.cpp @@ -20,7 +20,7 @@ // Source includes #include "Logger.hpp" #include "Path.hpp" -#include "codingUtilities/StringUtilities.hpp" // TODO F.C.Cu refactor: -> format/ +#include "common/format/StringUtilities.hpp" namespace geos { diff --git a/src/coreComponents/codingUtilities/StringUtilities.cpp b/src/coreComponents/common/format/StringUtilities.cpp similarity index 100% rename from src/coreComponents/codingUtilities/StringUtilities.cpp rename to src/coreComponents/common/format/StringUtilities.cpp diff --git a/src/coreComponents/codingUtilities/StringUtilities.hpp b/src/coreComponents/common/format/StringUtilities.hpp similarity index 98% rename from src/coreComponents/codingUtilities/StringUtilities.hpp rename to src/coreComponents/common/format/StringUtilities.hpp index 7f339d49fec..3c78264454e 100644 --- a/src/coreComponents/codingUtilities/StringUtilities.hpp +++ b/src/coreComponents/common/format/StringUtilities.hpp @@ -17,8 +17,8 @@ * @file StringUtilities.hpp */ -#ifndef GEOS_CODINGUTILITIES_STRINGUTILITIES_HPP_ -#define GEOS_CODINGUTILITIES_STRINGUTILITIES_HPP_ +#ifndef GEOS_COMMON_FORMAT_STRINGUTILITIES_HPP_ +#define GEOS_COMMON_FORMAT_STRINGUTILITIES_HPP_ #include "common/DataTypes.hpp" @@ -280,4 +280,4 @@ std::ostream & operator<<( std::ostream & os, std::optional< T > const & optValu } // namespace stringutilities } // namespace geos -#endif /* GEOS_CODINGUTILITIES_STRINGUTILITIES_HPP_ */ +#endif /* GEOS_COMMON_FORMAT_STRINGUTILITIES_HPP_ */ diff --git a/src/coreComponents/common/format/table/TableFormatter.cpp b/src/coreComponents/common/format/table/TableFormatter.cpp index 8d564e83ce5..369c0e37426 100644 --- a/src/coreComponents/common/format/table/TableFormatter.cpp +++ b/src/coreComponents/common/format/table/TableFormatter.cpp @@ -18,7 +18,7 @@ */ #include -#include "codingUtilities/StringUtilities.hpp" +#include "common/format/StringUtilities.hpp" #include "TableFormatter.hpp" namespace geos { diff --git a/src/coreComponents/common/format/unitTests/CMakeLists.txt b/src/coreComponents/common/format/unitTests/CMakeLists.txt new file mode 100644 index 00000000000..1684cd24bee --- /dev/null +++ b/src/coreComponents/common/format/unitTests/CMakeLists.txt @@ -0,0 +1,19 @@ +# Specify list of tests +set( testSources + testStringUtilities.cpp ) + +set( dependencyList gtest common ${parallelDeps} ) + +# Add gtest C++ based tests +foreach( test ${testSources} ) + + get_filename_component( test_name ${test} NAME_WE ) + blt_add_executable( NAME ${test_name} + SOURCES ${test} + OUTPUT_DIR ${TEST_OUTPUT_DIRECTORY} + DEPENDS_ON ${dependencyList} ) + + geos_add_test( NAME ${test_name} + COMMAND ${test_name} ) + +endforeach() diff --git a/src/coreComponents/codingUtilities/tests/testStringUtilities.cpp b/src/coreComponents/common/format/unitTests/testStringUtilities.cpp similarity index 100% rename from src/coreComponents/codingUtilities/tests/testStringUtilities.cpp rename to src/coreComponents/common/format/unitTests/testStringUtilities.cpp diff --git a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/PVTFunctionHelpers.hpp b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/PVTFunctionHelpers.hpp index 346d520acd3..f6b20d63ab4 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/PVTFunctionHelpers.hpp +++ b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/PVTFunctionHelpers.hpp @@ -20,7 +20,7 @@ #include "common/DataTypes.hpp" #include "common/Units.hpp" -#include "codingUtilities/StringUtilities.hpp" +#include "common/format/StringUtilities.hpp" #ifndef GEOS_CONSTITUTIVE_FLUID_MULTIFLUID_CO2BRINE_FUNCTIONS_PVTFUNCTIONHELPERS_HPP_ #define GEOS_CONSTITUTIVE_FLUID_MULTIFLUID_CO2BRINE_FUNCTIONS_PVTFUNCTIONHELPERS_HPP_ diff --git a/src/coreComponents/constitutive/fluid/multifluid/PVTDriver.cpp b/src/coreComponents/constitutive/fluid/multifluid/PVTDriver.cpp index 21cc399b274..8a987d2168b 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/PVTDriver.cpp +++ b/src/coreComponents/constitutive/fluid/multifluid/PVTDriver.cpp @@ -27,7 +27,7 @@ #include "fileIO/Outputs/OutputBase.hpp" #include "functions/FunctionManager.hpp" #include "functions/TableFunction.hpp" -#include "codingUtilities/StringUtilities.hpp" +#include "common/format/StringUtilities.hpp" #include diff --git a/src/coreComponents/dataRepository/Group.cpp b/src/coreComponents/dataRepository/Group.cpp index dccbc2441f8..e420631f5ff 100644 --- a/src/coreComponents/dataRepository/Group.cpp +++ b/src/coreComponents/dataRepository/Group.cpp @@ -16,7 +16,7 @@ // Source includes #include "Group.hpp" #include "ConduitRestart.hpp" -#include "codingUtilities/StringUtilities.hpp" +#include "common/format/StringUtilities.hpp" #include "codingUtilities/Utilities.hpp" #include "common/TimingMacros.hpp" #include "GroupContext.hpp" diff --git a/src/coreComponents/dataRepository/ObjectCatalog.hpp b/src/coreComponents/dataRepository/ObjectCatalog.hpp index 399f4270a4a..77c7566ef92 100644 --- a/src/coreComponents/dataRepository/ObjectCatalog.hpp +++ b/src/coreComponents/dataRepository/ObjectCatalog.hpp @@ -28,7 +28,7 @@ */ #include "common/Logger.hpp" -#include "codingUtilities/StringUtilities.hpp" +#include "common/format/StringUtilities.hpp" #include "LvArray/src/system.hpp" #include diff --git a/src/coreComponents/dataRepository/xmlWrapper.cpp b/src/coreComponents/dataRepository/xmlWrapper.cpp index 73fc7ad410b..4b4759980a0 100644 --- a/src/coreComponents/dataRepository/xmlWrapper.cpp +++ b/src/coreComponents/dataRepository/xmlWrapper.cpp @@ -21,7 +21,7 @@ #include "xmlWrapper.hpp" -#include "codingUtilities/StringUtilities.hpp" +#include "common/format/StringUtilities.hpp" #include "common/MpiWrapper.hpp" #include "dataRepository/KeyNames.hpp" diff --git a/src/coreComponents/dataRepository/xmlWrapper.hpp b/src/coreComponents/dataRepository/xmlWrapper.hpp index 5421bfaaedb..f73f3ecaa7e 100644 --- a/src/coreComponents/dataRepository/xmlWrapper.hpp +++ b/src/coreComponents/dataRepository/xmlWrapper.hpp @@ -26,7 +26,7 @@ #include "common/GEOS_RAJA_Interface.hpp" #include "LvArray/src/output.hpp" #include "LvArray/src/input.hpp" -#include "codingUtilities/StringUtilities.hpp" +#include "common/format/StringUtilities.hpp" #include "codingUtilities/RTTypes.hpp" // TPL includes diff --git a/src/coreComponents/fieldSpecification/FieldSpecificationManager.cpp b/src/coreComponents/fieldSpecification/FieldSpecificationManager.cpp index e284099013e..b24582179e4 100644 --- a/src/coreComponents/fieldSpecification/FieldSpecificationManager.cpp +++ b/src/coreComponents/fieldSpecification/FieldSpecificationManager.cpp @@ -15,7 +15,7 @@ #include "FieldSpecificationManager.hpp" -#include "codingUtilities/StringUtilities.hpp" +#include "common/format/StringUtilities.hpp" #include "constitutive/ConstitutiveManager.hpp" namespace geos diff --git a/src/coreComponents/fieldSpecification/FieldSpecificationManager.hpp b/src/coreComponents/fieldSpecification/FieldSpecificationManager.hpp index 9e1fcc59390..5ce5f1f9e01 100644 --- a/src/coreComponents/fieldSpecification/FieldSpecificationManager.hpp +++ b/src/coreComponents/fieldSpecification/FieldSpecificationManager.hpp @@ -22,7 +22,7 @@ #include "FieldSpecificationBase.hpp" -#include "codingUtilities/StringUtilities.hpp" +#include "common/format/StringUtilities.hpp" #include "common/DataTypes.hpp" #include "common/TimingMacros.hpp" #include "mesh/ObjectManagerBase.hpp" diff --git a/src/coreComponents/mainInterface/ProblemManager.cpp b/src/coreComponents/mainInterface/ProblemManager.cpp index 88b92fa57d1..605de331d8f 100644 --- a/src/coreComponents/mainInterface/ProblemManager.cpp +++ b/src/coreComponents/mainInterface/ProblemManager.cpp @@ -20,7 +20,7 @@ #include "GeosxState.hpp" #include "initialization.hpp" -#include "codingUtilities/StringUtilities.hpp" +#include "common/format/StringUtilities.hpp" #include "common/Path.hpp" #include "common/TimingMacros.hpp" #include "constitutive/ConstitutiveManager.hpp" diff --git a/src/coreComponents/mesh/FieldIdentifiers.hpp b/src/coreComponents/mesh/FieldIdentifiers.hpp index 77348072190..97ffdf998ab 100644 --- a/src/coreComponents/mesh/FieldIdentifiers.hpp +++ b/src/coreComponents/mesh/FieldIdentifiers.hpp @@ -21,7 +21,7 @@ #define GEOS_MESH_MPICOMMUNICATIONS_FIELDIDENTIFIERS_HPP_ #include "common/DataTypes.hpp" -#include "codingUtilities/StringUtilities.hpp" +#include "common/format/StringUtilities.hpp" namespace geos { diff --git a/src/coreComponents/mesh/simpleGeometricObjects/SimpleGeometricObjectBase.hpp b/src/coreComponents/mesh/simpleGeometricObjects/SimpleGeometricObjectBase.hpp index af81576df1e..a4b2665b9c3 100644 --- a/src/coreComponents/mesh/simpleGeometricObjects/SimpleGeometricObjectBase.hpp +++ b/src/coreComponents/mesh/simpleGeometricObjects/SimpleGeometricObjectBase.hpp @@ -21,7 +21,7 @@ #define GEOS_MESH_SIMPLEGEOMETRICOBJECTS_SIMPLEGEOMETRICOBJECTBASE_HPP_ #include "dataRepository/Group.hpp" -#include "codingUtilities/StringUtilities.hpp" +#include "common/format/StringUtilities.hpp" #include "dataRepository/ObjectCatalog.hpp" class Function; diff --git a/src/coreComponents/schema/schemaUtilities.cpp b/src/coreComponents/schema/schemaUtilities.cpp index 80a657db4a2..4be8a32ab5d 100644 --- a/src/coreComponents/schema/schemaUtilities.cpp +++ b/src/coreComponents/schema/schemaUtilities.cpp @@ -20,7 +20,7 @@ /// Source includes #include "schemaUtilities.hpp" -#include "codingUtilities/StringUtilities.hpp" +#include "common/format/StringUtilities.hpp" #include "common/DataTypes.hpp" #include "dataRepository/Group.hpp" #include "dataRepository/InputFlags.hpp" From ef68fd064ddfc4d5b3d09e9468414837349a9e5b Mon Sep 17 00:00:00 2001 From: MelReyCG Date: Fri, 26 Jul 2024 17:54:48 +0200 Subject: [PATCH 09/24] logger has now a dedicated folder for upcoming files (future PRs) --- examples/ObjectCatalog/main.cpp | 2 +- .../codingUtilities/CMakeLists.txt | 2 -- .../codingUtilities/EnumStrings.hpp | 2 +- .../codingUtilities/Parsing.hpp | 1 + .../codingUtilities/RTTypes.hpp | 36 +++++++++++++++++++ .../codingUtilities/Utilities.hpp | 1 + src/coreComponents/common/CMakeLists.txt | 7 ++-- src/coreComponents/common/DataTypes.hpp | 35 ------------------ .../common/FieldSpecificationOps.hpp | 2 +- src/coreComponents/common/FixedSizeDeque.hpp | 2 +- src/coreComponents/common/MemoryInfos.hpp | 2 +- .../common/MultiMutexesLock.hpp | 2 +- src/coreComponents/common/Path.cpp | 2 +- src/coreComponents/common/Span.hpp | 4 +-- src/coreComponents/common/TypeDispatch.hpp | 1 + src/coreComponents/common/Units.hpp | 1 + .../common/format/StringUtilities.cpp | 1 + .../common/{ => logger}/Logger.cpp | 2 +- .../common/{ => logger}/Logger.hpp | 0 .../ConstitutivePassThruHandler.hpp | 1 + .../CO2Brine/functions/CO2EOSSolver.cpp | 1 + .../CO2Brine/functions/PVTFunctionHelpers.hpp | 2 +- .../functions/CubicEOSPhaseModel.hpp | 1 + .../solid/DamageSpectralUtilities.hpp | 4 +++ .../dataRepository/BufferOps.hpp | 1 + .../dataRepository/DataContext.hpp | 2 +- .../dataRepository/HistoryDataSpec.hpp | 1 + .../dataRepository/InputFlags.hpp | 2 +- .../dataRepository/MappedVector.hpp | 2 +- .../dataRepository/ObjectCatalog.hpp | 2 +- .../dataRepository/RestartFlags.hpp | 8 +++-- .../interfaces/blaslapack/BlasLapackLA.cpp | 2 ++ .../unitTests/testSolveLinearSystem.cpp | 1 + .../fileIO/Outputs/OutputUtilities.cpp | 2 +- src/coreComponents/fileIO/silo/SiloFile.cpp | 2 +- .../fileIO/vtk/VTKPolyDataWriterInterface.cpp | 2 +- .../linearAlgebra/common/common.hpp | 1 + .../linearAlgebra/utilities/ComponentMask.hpp | 2 +- .../mainInterface/GeosxState.hpp | 1 + src/coreComponents/mainInterface/version.cpp | 2 +- src/coreComponents/mesh/FaceManager.cpp | 2 +- src/coreComponents/mesh/FieldIdentifiers.hpp | 1 + .../mesh/mpiCommunications/CommID.cpp | 2 +- .../NonlinearSolverParameters.cpp | 2 +- .../dataRepositoryTests/testObjectCatalog.cpp | 2 +- .../testMimeticInnerProducts.cpp | 2 +- 46 files changed, 88 insertions(+), 70 deletions(-) rename src/coreComponents/common/{ => logger}/Logger.cpp (99%) rename src/coreComponents/common/{ => logger}/Logger.hpp (100%) diff --git a/examples/ObjectCatalog/main.cpp b/examples/ObjectCatalog/main.cpp index 2304c252821..c2fd08113d5 100644 --- a/examples/ObjectCatalog/main.cpp +++ b/examples/ObjectCatalog/main.cpp @@ -17,7 +17,7 @@ #include -#include "common/Logger.hpp" +#include "common/logger/Logger.hpp" #include "Base.hpp" #include "Derived1.hpp" diff --git a/src/coreComponents/codingUtilities/CMakeLists.txt b/src/coreComponents/codingUtilities/CMakeLists.txt index 3740557b2cf..a85e4046907 100644 --- a/src/coreComponents/codingUtilities/CMakeLists.txt +++ b/src/coreComponents/codingUtilities/CMakeLists.txt @@ -9,7 +9,6 @@ set( codingUtilities_headers UnitTestUtilities.hpp Utilities.hpp traits.hpp - # TODO F.C.Cu refactor: add xmlWrapper.hpp ) # @@ -18,7 +17,6 @@ set( codingUtilities_headers set( codingUtilities_sources Parsing.cpp RTTypes.cpp - # TODO F.C.Cu refactor: add xmlWrapper.cpp ) set( dependencyList ${parallelDeps} common fast_float ) diff --git a/src/coreComponents/codingUtilities/EnumStrings.hpp b/src/coreComponents/codingUtilities/EnumStrings.hpp index 1a17b2c9970..40930b1b222 100644 --- a/src/coreComponents/codingUtilities/EnumStrings.hpp +++ b/src/coreComponents/codingUtilities/EnumStrings.hpp @@ -28,7 +28,7 @@ #include "common/format/StringUtilities.hpp" #include "codingUtilities/RTTypes.hpp" #include "common/DataTypes.hpp" -#include "common/Logger.hpp" +#include "common/logger/Logger.hpp" #include "common/format/Format.hpp" #include diff --git a/src/coreComponents/codingUtilities/Parsing.hpp b/src/coreComponents/codingUtilities/Parsing.hpp index e99f751bbc4..1f6dcf36c57 100644 --- a/src/coreComponents/codingUtilities/Parsing.hpp +++ b/src/coreComponents/codingUtilities/Parsing.hpp @@ -21,6 +21,7 @@ #define GEOS_CODINGUTILITIES_PARSING_HPP_ #include "common/DataTypes.hpp" +#include "common/logger/Logger.hpp" #include diff --git a/src/coreComponents/codingUtilities/RTTypes.hpp b/src/coreComponents/codingUtilities/RTTypes.hpp index 16ca875a146..a94c6cb8236 100644 --- a/src/coreComponents/codingUtilities/RTTypes.hpp +++ b/src/coreComponents/codingUtilities/RTTypes.hpp @@ -24,10 +24,46 @@ #define GEOS_CODINGUTILITIES_RTTYPES_HPP #include "common/DataTypes.hpp" +#include "common/format/Format.hpp" +#include "common/logger/Logger.hpp" namespace geos { +/** + * @brief Perform a type cast of base to derived pointer. + * @tparam NEW_TYPE derived pointer type + * @tparam EXISTING_TYPE base type + * @param val base pointer to cast + * @return pointer cast to derived type or @p nullptr + */ +template< typename NEW_TYPE, typename EXISTING_TYPE > +NEW_TYPE dynamicCast( EXISTING_TYPE * const val ) +{ + static_assert( std::is_pointer< NEW_TYPE >::value, "NEW_TYPE must be a pointer." ); + return dynamic_cast< NEW_TYPE >( val ); +} + +/** + * @brief Perform a type cast of base to derived reference. + * @tparam NEW_TYPE derived reference type + * @tparam EXISTING_TYPE base type + * @param val base reference to cast + * @return reference cast to derived type or @p nullptr + */ +template< typename NEW_TYPE, typename EXISTING_TYPE > +NEW_TYPE dynamicCast( EXISTING_TYPE & val ) +{ + static_assert( std::is_reference< NEW_TYPE >::value, "NEW_TYPE must be a reference." ); + + using POINTER_TO_NEW_TYPE = std::remove_reference_t< NEW_TYPE > *; + POINTER_TO_NEW_TYPE ptr = dynamicCast< POINTER_TO_NEW_TYPE >( &val ); + GEOS_ERROR_IF( ptr == nullptr, "Cast from " << LvArray::system::demangleType( val ) << " to " << + LvArray::system::demangleType< NEW_TYPE >() << " failed." ); + + return *ptr; +} + /** * @brief Print a short summary of a few select type aliases. */ diff --git a/src/coreComponents/codingUtilities/Utilities.hpp b/src/coreComponents/codingUtilities/Utilities.hpp index a8192c7052e..41fdc9c8e46 100644 --- a/src/coreComponents/codingUtilities/Utilities.hpp +++ b/src/coreComponents/codingUtilities/Utilities.hpp @@ -21,6 +21,7 @@ #define GEOS_CODINGUTILITIES_UTILITIES_H_ #include "common/format/StringUtilities.hpp" +#include "common/logger/Logger.hpp" #include "common/DataTypes.hpp" #include "LvArray/src/limits.hpp" #include "common/GEOS_RAJA_Interface.hpp" diff --git a/src/coreComponents/common/CMakeLists.txt b/src/coreComponents/common/CMakeLists.txt index bb9d3fec1fe..2a5f70ff960 100644 --- a/src/coreComponents/common/CMakeLists.txt +++ b/src/coreComponents/common/CMakeLists.txt @@ -3,12 +3,12 @@ # set( common_headers ${CMAKE_BINARY_DIR}/include/common/GeosxConfig.hpp - Logger.hpp # TODO F.C.Cu refactor: logger/Logger.hpp format/table/TableLayout.hpp format/table/TableFormatter.hpp format/table/TableData.hpp format/Format.hpp format/StringUtilities.hpp + logger/Logger.hpp BufferAllocator.hpp DataLayouts.hpp DataTypes.hpp @@ -43,11 +43,11 @@ endif( ) # Specify all sources # set( common_sources - Logger.cpp # TODO F.C.Cu refactor: logger/Logger.cpp format/table/TableLayout.cpp format/table/TableFormatter.cpp format/table/TableData.cpp format/StringUtilities.cpp + logger/Logger.cpp BufferAllocator.cpp MemoryInfos.cpp MpiWrapper.cpp @@ -102,9 +102,6 @@ if( ENABLE_CALIPER ) endif() endif() - # TODO F.C.Cu refactor: remove codingUtilities - # - move Logger.xpp in basicIO/logger/* - # - move hdf5Interface in basicIO/* set( dependencyList ${dependencyList} ) blt_add_library( NAME common diff --git a/src/coreComponents/common/DataTypes.hpp b/src/coreComponents/common/DataTypes.hpp index 47fbe4e1cc3..9f4c8608ff7 100644 --- a/src/coreComponents/common/DataTypes.hpp +++ b/src/coreComponents/common/DataTypes.hpp @@ -29,7 +29,6 @@ #include "BufferAllocator.hpp" #include "DataLayouts.hpp" #include "Tensor.hpp" -#include "Logger.hpp" // TODO F.C.Cu refactor: remove from here as it is not static type related and call it from higher level files #include "LvArray/src/Macros.hpp" #include "LvArray/src/Array.hpp" #include "LvArray/src/ArrayOfArrays.hpp" @@ -71,40 +70,6 @@ namespace geos { -/** - * @brief Perform a type cast of base to derived pointer. - * @tparam NEW_TYPE derived pointer type - * @tparam EXISTING_TYPE base type - * @param val base pointer to cast - * @return pointer cast to derived type or @p nullptr - */ -template< typename NEW_TYPE, typename EXISTING_TYPE > -NEW_TYPE dynamicCast( EXISTING_TYPE * const val ) // TODO F.C.Cu refactor: try to move that in RTTypes.hpp -{ - static_assert( std::is_pointer< NEW_TYPE >::value, "NEW_TYPE must be a pointer." ); - return dynamic_cast< NEW_TYPE >( val ); -} - -/** - * @brief Perform a type cast of base to derived reference. - * @tparam NEW_TYPE derived reference type - * @tparam EXISTING_TYPE base type - * @param val base reference to cast - * @return reference cast to derived type or @p nullptr - */ -template< typename NEW_TYPE, typename EXISTING_TYPE > -NEW_TYPE dynamicCast( EXISTING_TYPE & val ) // TODO F.C.Cu refactor: try to move that in RTTypes.hpp -{ - static_assert( std::is_reference< NEW_TYPE >::value, "NEW_TYPE must be a reference." ); - - using POINTER_TO_NEW_TYPE = std::remove_reference_t< NEW_TYPE > *; - POINTER_TO_NEW_TYPE ptr = dynamicCast< POINTER_TO_NEW_TYPE >( &val ); - GEOS_ERROR_IF( ptr == nullptr, "Cast from " << LvArray::system::demangleType( val ) << " to " << - LvArray::system::demangleType< NEW_TYPE >() << " failed." ); - - return *ptr; -} - /** * @name Basic data types used in GEOSX. */ diff --git a/src/coreComponents/common/FieldSpecificationOps.hpp b/src/coreComponents/common/FieldSpecificationOps.hpp index aaa1d24db7a..684b90af9e5 100644 --- a/src/coreComponents/common/FieldSpecificationOps.hpp +++ b/src/coreComponents/common/FieldSpecificationOps.hpp @@ -20,7 +20,7 @@ #ifndef GEOS_COMMON_FIELDSPECIFICATIONOPS_HPP #define GEOS_COMMON_FIELDSPECIFICATIONOPS_HPP -#include "codingUtilities/traits.hpp" // TODO F.C.Cu refactor: why? what can we do about it? can we just ignore it for now? +#include "codingUtilities/traits.hpp" #include "common/DataTypes.hpp" #include "common/GEOS_RAJA_Interface.hpp" diff --git a/src/coreComponents/common/FixedSizeDeque.hpp b/src/coreComponents/common/FixedSizeDeque.hpp index 11b0a58fc17..629f1d8f42e 100644 --- a/src/coreComponents/common/FixedSizeDeque.hpp +++ b/src/coreComponents/common/FixedSizeDeque.hpp @@ -19,7 +19,7 @@ #include "LvArray/src/Array.hpp" #include "LvArray/src/memcpy.hpp" #include "LvArray/src/ChaiBuffer.hpp" -#include "common/Logger.hpp" +#include "common/logger/Logger.hpp" /// Get the positive value of a module b #define POSITIVE_MODULO( a, b ) ( ( ( a ) % ( b ) ) + b ) % ( b ) diff --git a/src/coreComponents/common/MemoryInfos.hpp b/src/coreComponents/common/MemoryInfos.hpp index 3f048d5ac8a..90763a7f18d 100644 --- a/src/coreComponents/common/MemoryInfos.hpp +++ b/src/coreComponents/common/MemoryInfos.hpp @@ -17,7 +17,7 @@ #define GEOS_COMMON_MemoryInfos_HPP_ #include "umpire/util/MemoryResourceTraits.hpp" -#include "common/Logger.hpp" +#include "common/logger/Logger.hpp" #include #include #if defined( GEOS_USE_CUDA ) diff --git a/src/coreComponents/common/MultiMutexesLock.hpp b/src/coreComponents/common/MultiMutexesLock.hpp index 5f505c9c85c..f338fea4478 100644 --- a/src/coreComponents/common/MultiMutexesLock.hpp +++ b/src/coreComponents/common/MultiMutexesLock.hpp @@ -19,7 +19,7 @@ #include #include -#include "codingUtilities/Utilities.hpp" // TODO F.C.Cu refactor: -> common/ +#include "codingUtilities/Utilities.hpp" namespace geos { diff --git a/src/coreComponents/common/Path.cpp b/src/coreComponents/common/Path.cpp index 50993a1a2da..853f4557904 100644 --- a/src/coreComponents/common/Path.cpp +++ b/src/coreComponents/common/Path.cpp @@ -14,7 +14,7 @@ */ #include "Path.hpp" -#include "Logger.hpp" +#include "logger/Logger.hpp" #include #include diff --git a/src/coreComponents/common/Span.hpp b/src/coreComponents/common/Span.hpp index ca83dacc4db..4623fdcdf5f 100644 --- a/src/coreComponents/common/Span.hpp +++ b/src/coreComponents/common/Span.hpp @@ -20,8 +20,8 @@ #ifndef GEOS_COMMON_SPAN_HPP #define GEOS_COMMON_SPAN_HPP -#include "codingUtilities/traits.hpp" // TODO F.C.Cu refactor: why? what can we do about it? can we just ignore it for now? -#include "common/Logger.hpp" +#include "codingUtilities/traits.hpp" +#include "common/logger/Logger.hpp" #include #include diff --git a/src/coreComponents/common/TypeDispatch.hpp b/src/coreComponents/common/TypeDispatch.hpp index 0d4f1a8d761..d01ddf58637 100644 --- a/src/coreComponents/common/TypeDispatch.hpp +++ b/src/coreComponents/common/TypeDispatch.hpp @@ -23,6 +23,7 @@ #define GEOS_COMMON_TYPEDISPATCH_HPP #include "common/DataTypes.hpp" +#include "common/logger/Logger.hpp" #include diff --git a/src/coreComponents/common/Units.hpp b/src/coreComponents/common/Units.hpp index 80b94a94d8d..4749c89ad4a 100644 --- a/src/coreComponents/common/Units.hpp +++ b/src/coreComponents/common/Units.hpp @@ -22,6 +22,7 @@ #include "common/DataTypes.hpp" #include "common/PhysicsConstants.hpp" +#include "common/format/Format.hpp" namespace geos { diff --git a/src/coreComponents/common/format/StringUtilities.cpp b/src/coreComponents/common/format/StringUtilities.cpp index 2a1face950c..0c692f6a17d 100644 --- a/src/coreComponents/common/format/StringUtilities.cpp +++ b/src/coreComponents/common/format/StringUtilities.cpp @@ -18,6 +18,7 @@ */ #include "StringUtilities.hpp" +#include "common/logger/Logger.hpp" #include "limits.h" #include diff --git a/src/coreComponents/common/Logger.cpp b/src/coreComponents/common/logger/Logger.cpp similarity index 99% rename from src/coreComponents/common/Logger.cpp rename to src/coreComponents/common/logger/Logger.cpp index e0c99136171..c730e8168ad 100644 --- a/src/coreComponents/common/Logger.cpp +++ b/src/coreComponents/common/logger/Logger.cpp @@ -19,7 +19,7 @@ // Source includes #include "Logger.hpp" -#include "Path.hpp" +#include "common/Path.hpp" #include "common/format/StringUtilities.hpp" namespace geos diff --git a/src/coreComponents/common/Logger.hpp b/src/coreComponents/common/logger/Logger.hpp similarity index 100% rename from src/coreComponents/common/Logger.hpp rename to src/coreComponents/common/logger/Logger.hpp diff --git a/src/coreComponents/constitutive/ConstitutivePassThruHandler.hpp b/src/coreComponents/constitutive/ConstitutivePassThruHandler.hpp index 6430e1dfa78..631b32d6b2f 100644 --- a/src/coreComponents/constitutive/ConstitutivePassThruHandler.hpp +++ b/src/coreComponents/constitutive/ConstitutivePassThruHandler.hpp @@ -20,6 +20,7 @@ #define GEOS_CONSTITUTIVEPASSTHRUHANDLER_HPP #include "codingUtilities/traits.hpp" +#include "codingUtilities/RTTypes.hpp" #include "common/DataTypes.hpp" namespace geos diff --git a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/CO2EOSSolver.cpp b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/CO2EOSSolver.cpp index 1e314cbe6ee..8bae9da6bd3 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/CO2EOSSolver.cpp +++ b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/CO2EOSSolver.cpp @@ -20,6 +20,7 @@ #include "constitutive/fluid/multifluid/CO2Brine/functions/CO2EOSSolver.hpp" #include "common/Units.hpp" +#include "common/logger/Logger.hpp" namespace geos diff --git a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/PVTFunctionHelpers.hpp b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/PVTFunctionHelpers.hpp index f6b20d63ab4..1d93b628265 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/PVTFunctionHelpers.hpp +++ b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/PVTFunctionHelpers.hpp @@ -19,7 +19,7 @@ #include "common/DataTypes.hpp" #include "common/Units.hpp" - +#include "common/logger/Logger.hpp" #include "common/format/StringUtilities.hpp" #ifndef GEOS_CONSTITUTIVE_FLUID_MULTIFLUID_CO2BRINE_FUNCTIONS_PVTFUNCTIONHELPERS_HPP_ diff --git a/src/coreComponents/constitutive/fluid/multifluid/compositional/functions/CubicEOSPhaseModel.hpp b/src/coreComponents/constitutive/fluid/multifluid/compositional/functions/CubicEOSPhaseModel.hpp index 7b3a860bf37..d992157f521 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/compositional/functions/CubicEOSPhaseModel.hpp +++ b/src/coreComponents/constitutive/fluid/multifluid/compositional/functions/CubicEOSPhaseModel.hpp @@ -21,6 +21,7 @@ #define GEOS_CONSTITUTIVE_FLUID_MULTIFLUID_COMPOSITIONAL_FUNCTIONS_CUBICEOSPHASEMODEL_HPP_ #include "common/DataTypes.hpp" +#include "common/logger/Logger.hpp" #include "constitutive/fluid/multifluid/MultiFluidConstants.hpp" #include "constitutive/fluid/multifluid/Layouts.hpp" #include "constitutive/fluid/multifluid/compositional/models/ComponentProperties.hpp" diff --git a/src/coreComponents/constitutive/solid/DamageSpectralUtilities.hpp b/src/coreComponents/constitutive/solid/DamageSpectralUtilities.hpp index eb8a32de7a9..bd0584af82c 100644 --- a/src/coreComponents/constitutive/solid/DamageSpectralUtilities.hpp +++ b/src/coreComponents/constitutive/solid/DamageSpectralUtilities.hpp @@ -26,11 +26,15 @@ #ifndef GEOS_CONSTITUTIVE_SOLID_DAMAGESPECTRALUTILITIES_HPP_ #define GEOS_CONSTITUTIVE_SOLID_DAMAGESPECTRALUTILITIES_HPP_ + #include #include #include #include "LvArray/src/output.hpp" #include "LvArray/src/tensorOps.hpp" +#include "common/DataTypes.hpp" +#include "common/logger/Logger.hpp" + namespace geos { diff --git a/src/coreComponents/dataRepository/BufferOps.hpp b/src/coreComponents/dataRepository/BufferOps.hpp index 5b460851747..65ff284d676 100644 --- a/src/coreComponents/dataRepository/BufferOps.hpp +++ b/src/coreComponents/dataRepository/BufferOps.hpp @@ -19,6 +19,7 @@ #define GEOS_DATAREPOSITORY_BUFFEROPS_HPP_ #include "common/DataTypes.hpp" +#include "common/logger/Logger.hpp" #include "codingUtilities/Utilities.hpp" #include "codingUtilities/traits.hpp" #include "LvArray/src/limits.hpp" diff --git a/src/coreComponents/dataRepository/DataContext.hpp b/src/coreComponents/dataRepository/DataContext.hpp index 06190b33732..403b2fb5e55 100644 --- a/src/coreComponents/dataRepository/DataContext.hpp +++ b/src/coreComponents/dataRepository/DataContext.hpp @@ -21,7 +21,7 @@ #define GEOS_DATAREPOSITORY_DATACONTEXT_HPP_ #include "common/DataTypes.hpp" -#include "common/Logger.hpp" +#include "common/logger/Logger.hpp" #include "xmlWrapper.hpp" #include "common/format/Format.hpp" diff --git a/src/coreComponents/dataRepository/HistoryDataSpec.hpp b/src/coreComponents/dataRepository/HistoryDataSpec.hpp index 01930b3e935..3fd0d56b3a5 100644 --- a/src/coreComponents/dataRepository/HistoryDataSpec.hpp +++ b/src/coreComponents/dataRepository/HistoryDataSpec.hpp @@ -22,6 +22,7 @@ #include "codingUtilities/traits.hpp" #include "common/DataTypes.hpp" +#include "common/logger/Logger.hpp" #include "LvArray/src/Array.hpp" namespace geos diff --git a/src/coreComponents/dataRepository/InputFlags.hpp b/src/coreComponents/dataRepository/InputFlags.hpp index f40d868a278..72dc4d862b2 100644 --- a/src/coreComponents/dataRepository/InputFlags.hpp +++ b/src/coreComponents/dataRepository/InputFlags.hpp @@ -21,7 +21,7 @@ #define GEOS_DATAREPOSITORY_INPUTFLAGS_HPP_ #include "common/DataTypes.hpp" -#include "common/Logger.hpp" +#include "common/logger/Logger.hpp" namespace geos { diff --git a/src/coreComponents/dataRepository/MappedVector.hpp b/src/coreComponents/dataRepository/MappedVector.hpp index a10c1d93870..82fd0d6f3b3 100644 --- a/src/coreComponents/dataRepository/MappedVector.hpp +++ b/src/coreComponents/dataRepository/MappedVector.hpp @@ -23,7 +23,7 @@ // Source includes #include "KeyIndexT.hpp" #include "common/GeosxMacros.hpp" -#include "common/Logger.hpp" +#include "common/logger/Logger.hpp" #include "LvArray/src/limits.hpp" // System includes diff --git a/src/coreComponents/dataRepository/ObjectCatalog.hpp b/src/coreComponents/dataRepository/ObjectCatalog.hpp index 77c7566ef92..71c7d7a2f84 100644 --- a/src/coreComponents/dataRepository/ObjectCatalog.hpp +++ b/src/coreComponents/dataRepository/ObjectCatalog.hpp @@ -27,7 +27,7 @@ * of a */ -#include "common/Logger.hpp" +#include "common/logger/Logger.hpp" #include "common/format/StringUtilities.hpp" #include "LvArray/src/system.hpp" diff --git a/src/coreComponents/dataRepository/RestartFlags.hpp b/src/coreComponents/dataRepository/RestartFlags.hpp index a37b98f038f..c827ee4d0bb 100644 --- a/src/coreComponents/dataRepository/RestartFlags.hpp +++ b/src/coreComponents/dataRepository/RestartFlags.hpp @@ -13,13 +13,15 @@ * ------------------------------------------------------------------------------------------------------------ */ -#ifndef GEOS_DATAREPOSITORY_RESTARTFLAGS_HPP_ -#define GEOS_DATAREPOSITORY_RESTARTFLAGS_HPP_ - /** * @file RestartFlags.hpp */ +#ifndef GEOS_DATAREPOSITORY_RESTARTFLAGS_HPP_ +#define GEOS_DATAREPOSITORY_RESTARTFLAGS_HPP_ + +#include "common/logger/Logger.hpp" + namespace geos { namespace dataRepository diff --git a/src/coreComponents/denseLinearAlgebra/interfaces/blaslapack/BlasLapackLA.cpp b/src/coreComponents/denseLinearAlgebra/interfaces/blaslapack/BlasLapackLA.cpp index 4f5f5dc9001..e9831519596 100644 --- a/src/coreComponents/denseLinearAlgebra/interfaces/blaslapack/BlasLapackLA.cpp +++ b/src/coreComponents/denseLinearAlgebra/interfaces/blaslapack/BlasLapackLA.cpp @@ -23,6 +23,8 @@ // BLAS and LAPACK function declaration #include "denseLinearAlgebra/interfaces/blaslapack/BlasLapackFunctions.h" +#include "common/logger/Logger.hpp" + #include // Put everything under the geos namespace. diff --git a/src/coreComponents/denseLinearAlgebra/unitTests/testSolveLinearSystem.cpp b/src/coreComponents/denseLinearAlgebra/unitTests/testSolveLinearSystem.cpp index 343bb7e2d5d..5fc85de2864 100644 --- a/src/coreComponents/denseLinearAlgebra/unitTests/testSolveLinearSystem.cpp +++ b/src/coreComponents/denseLinearAlgebra/unitTests/testSolveLinearSystem.cpp @@ -19,6 +19,7 @@ // Source includes #include "denseLinearAlgebra/interfaces/blaslapack/BlasLapackLA.hpp" +#include "common/logger/Logger.hpp" #include "gtest/gtest.h" diff --git a/src/coreComponents/fileIO/Outputs/OutputUtilities.cpp b/src/coreComponents/fileIO/Outputs/OutputUtilities.cpp index 71814f162c3..a52c011ff57 100644 --- a/src/coreComponents/fileIO/Outputs/OutputUtilities.cpp +++ b/src/coreComponents/fileIO/Outputs/OutputUtilities.cpp @@ -19,7 +19,7 @@ #include "OutputUtilities.hpp" -#include "common/Logger.hpp" +#include "common/logger/Logger.hpp" #include "mesh/ElementRegionManager.hpp" #include "mesh/NodeManager.hpp" diff --git a/src/coreComponents/fileIO/silo/SiloFile.cpp b/src/coreComponents/fileIO/silo/SiloFile.cpp index cb2882bb36f..d8a27996ad7 100644 --- a/src/coreComponents/fileIO/silo/SiloFile.cpp +++ b/src/coreComponents/fileIO/silo/SiloFile.cpp @@ -25,7 +25,7 @@ #include "codingUtilities/Utilities.hpp" #include "common/DataTypes.hpp" -#include "common/Logger.hpp" +#include "common/logger/Logger.hpp" #include "common/MpiWrapper.hpp" #include "common/TypeDispatch.hpp" #include "constitutive/ConstitutiveManager.hpp" diff --git a/src/coreComponents/fileIO/vtk/VTKPolyDataWriterInterface.cpp b/src/coreComponents/fileIO/vtk/VTKPolyDataWriterInterface.cpp index f4c8b0ff21d..5aeeedcc4f4 100644 --- a/src/coreComponents/fileIO/vtk/VTKPolyDataWriterInterface.cpp +++ b/src/coreComponents/fileIO/vtk/VTKPolyDataWriterInterface.cpp @@ -16,7 +16,7 @@ // Source includes #include "VTKPolyDataWriterInterface.hpp" -#include "common/Logger.hpp" +#include "common/logger/Logger.hpp" #include "common/TypeDispatch.hpp" #include "dataRepository/Group.hpp" #include "mesh/DomainPartition.hpp" diff --git a/src/coreComponents/linearAlgebra/common/common.hpp b/src/coreComponents/linearAlgebra/common/common.hpp index 236e7811eba..214441231c3 100644 --- a/src/coreComponents/linearAlgebra/common/common.hpp +++ b/src/coreComponents/linearAlgebra/common/common.hpp @@ -20,6 +20,7 @@ #define GEOS_LINEARALGEBRA_INTERFACES_COMMON_HPP_ #include "common/DataTypes.hpp" +#include "common/logger/Logger.hpp" /** * Whether to check preconditions at runtime in LAI functions diff --git a/src/coreComponents/linearAlgebra/utilities/ComponentMask.hpp b/src/coreComponents/linearAlgebra/utilities/ComponentMask.hpp index 820a119692e..c7aa5f5ad4a 100644 --- a/src/coreComponents/linearAlgebra/utilities/ComponentMask.hpp +++ b/src/coreComponents/linearAlgebra/utilities/ComponentMask.hpp @@ -21,7 +21,7 @@ #define GEOS_LINEARALGEBRA_UTILITIES_COMPONENTMASK_HPP_ #include "common/GeosxMacros.hpp" -#include "common/Logger.hpp" +#include "common/logger/Logger.hpp" #include diff --git a/src/coreComponents/mainInterface/GeosxState.hpp b/src/coreComponents/mainInterface/GeosxState.hpp index ecefd151fa4..8d6866827d7 100644 --- a/src/coreComponents/mainInterface/GeosxState.hpp +++ b/src/coreComponents/mainInterface/GeosxState.hpp @@ -22,6 +22,7 @@ // Source includes #include "common/DataTypes.hpp" +#include "common/logger/Logger.hpp" // System includes #include diff --git a/src/coreComponents/mainInterface/version.cpp b/src/coreComponents/mainInterface/version.cpp index 196fef6739d..eb74e831080 100644 --- a/src/coreComponents/mainInterface/version.cpp +++ b/src/coreComponents/mainInterface/version.cpp @@ -14,7 +14,7 @@ */ #include "common/GeosxConfig.hpp" -#include "common/Logger.hpp" +#include "common/logger/Logger.hpp" #include "mainInterface/GeosxVersion.hpp" namespace geos diff --git a/src/coreComponents/mesh/FaceManager.cpp b/src/coreComponents/mesh/FaceManager.cpp index a397986186c..7942f825f29 100644 --- a/src/coreComponents/mesh/FaceManager.cpp +++ b/src/coreComponents/mesh/FaceManager.cpp @@ -20,7 +20,7 @@ #include "FaceManager.hpp" #include "common/GEOS_RAJA_Interface.hpp" -#include "common/Logger.hpp" +#include "common/logger/Logger.hpp" #include "common/TimingMacros.hpp" #include "LvArray/src/tensorOps.hpp" #include "mesh/BufferOps.hpp" diff --git a/src/coreComponents/mesh/FieldIdentifiers.hpp b/src/coreComponents/mesh/FieldIdentifiers.hpp index 97ffdf998ab..9d78e471933 100644 --- a/src/coreComponents/mesh/FieldIdentifiers.hpp +++ b/src/coreComponents/mesh/FieldIdentifiers.hpp @@ -22,6 +22,7 @@ #include "common/DataTypes.hpp" #include "common/format/StringUtilities.hpp" +#include "common/logger/Logger.hpp" namespace geos { diff --git a/src/coreComponents/mesh/mpiCommunications/CommID.cpp b/src/coreComponents/mesh/mpiCommunications/CommID.cpp index b7150525b3d..b4310c23fb8 100644 --- a/src/coreComponents/mesh/mpiCommunications/CommID.cpp +++ b/src/coreComponents/mesh/mpiCommunications/CommID.cpp @@ -15,7 +15,7 @@ #include "CommID.hpp" -#include "common/Logger.hpp" +#include "common/logger/Logger.hpp" #include diff --git a/src/coreComponents/physicsSolvers/NonlinearSolverParameters.cpp b/src/coreComponents/physicsSolvers/NonlinearSolverParameters.cpp index fae9f3c8236..8316485d56f 100644 --- a/src/coreComponents/physicsSolvers/NonlinearSolverParameters.cpp +++ b/src/coreComponents/physicsSolvers/NonlinearSolverParameters.cpp @@ -14,7 +14,7 @@ */ #include "NonlinearSolverParameters.hpp" -#include "common/Logger.hpp" +#include "common/logger/Logger.hpp" #include "common/format/table/TableFormatter.hpp" namespace geos diff --git a/src/coreComponents/unitTests/dataRepositoryTests/testObjectCatalog.cpp b/src/coreComponents/unitTests/dataRepositoryTests/testObjectCatalog.cpp index 2d7f0631b71..365e1c1124b 100644 --- a/src/coreComponents/unitTests/dataRepositoryTests/testObjectCatalog.cpp +++ b/src/coreComponents/unitTests/dataRepositoryTests/testObjectCatalog.cpp @@ -17,7 +17,7 @@ // Source includes #include "dataRepository/ObjectCatalog.hpp" -#include "common/Logger.hpp" +#include "common/logger/Logger.hpp" #include "mainInterface/initialization.hpp" // TPL includes diff --git a/src/coreComponents/unitTests/finiteVolumeTests/testMimeticInnerProducts.cpp b/src/coreComponents/unitTests/finiteVolumeTests/testMimeticInnerProducts.cpp index aa5fd0b8b5a..fa265348074 100644 --- a/src/coreComponents/unitTests/finiteVolumeTests/testMimeticInnerProducts.cpp +++ b/src/coreComponents/unitTests/finiteVolumeTests/testMimeticInnerProducts.cpp @@ -15,7 +15,7 @@ // Source includes #include "codingUtilities/UnitTestUtilities.hpp" -#include "common/Logger.hpp" +#include "common/logger/Logger.hpp" #include "finiteVolume/mimeticInnerProducts/MimeticInnerProductBase.hpp" #include "finiteVolume/mimeticInnerProducts/TPFAInnerProduct.hpp" #include "finiteVolume/mimeticInnerProducts/QuasiTPFAInnerProduct.hpp" From 71d9dbc892a80815249c4e606f9fc8a01f1bf9a6 Mon Sep 17 00:00:00 2001 From: MelReyCG Date: Mon, 29 Jul 2024 08:46:03 +0200 Subject: [PATCH 10/24] =?UTF-8?q?=F0=9F=90=9B=20compil=20fix=20(dynamicCas?= =?UTF-8?q?t)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../linearAlgebra/interfaces/trilinos/EpetraMatrix.cpp | 1 + .../linearAlgebra/interfaces/trilinos/EpetraVector.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/src/coreComponents/linearAlgebra/interfaces/trilinos/EpetraMatrix.cpp b/src/coreComponents/linearAlgebra/interfaces/trilinos/EpetraMatrix.cpp index 6b5b5fd68ec..9064b7ae12a 100644 --- a/src/coreComponents/linearAlgebra/interfaces/trilinos/EpetraMatrix.cpp +++ b/src/coreComponents/linearAlgebra/interfaces/trilinos/EpetraMatrix.cpp @@ -21,6 +21,7 @@ #include "codingUtilities/Utilities.hpp" #include "linearAlgebra/interfaces/trilinos/EpetraUtils.hpp" +#include "RTTypes.hpp" #include #include diff --git a/src/coreComponents/linearAlgebra/interfaces/trilinos/EpetraVector.cpp b/src/coreComponents/linearAlgebra/interfaces/trilinos/EpetraVector.cpp index 2993d566997..cb540f0053b 100644 --- a/src/coreComponents/linearAlgebra/interfaces/trilinos/EpetraVector.cpp +++ b/src/coreComponents/linearAlgebra/interfaces/trilinos/EpetraVector.cpp @@ -21,6 +21,7 @@ #include "codingUtilities/Utilities.hpp" #include "linearAlgebra/interfaces/trilinos/EpetraUtils.hpp" +#include "RTTypes.hpp" #include #include From e66095047896dac178f703bdef69d7121f1d9221 Mon Sep 17 00:00:00 2001 From: MelReyCG Date: Mon, 29 Jul 2024 12:27:27 +0200 Subject: [PATCH 11/24] =?UTF-8?q?=F0=9F=93=9D=20missed=20docs=20(where=20n?= =?UTF-8?q?ot=20previously=20catched=20by=20the=20CI)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/coreComponents/common/format/StringUtilities.hpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/coreComponents/common/format/StringUtilities.hpp b/src/coreComponents/common/format/StringUtilities.hpp index 3c78264454e..b8e9eaf43b0 100644 --- a/src/coreComponents/common/format/StringUtilities.hpp +++ b/src/coreComponents/common/format/StringUtilities.hpp @@ -65,8 +65,8 @@ string join( IT first, IT last, S const & delim = S() ) /** * @brief Join strings or other printable objects with a delimiter. * @tparam CONTAINER type of container to join - * @tparam S type of delimiter, usually char, char const * or string - * @param container container to join + * @tparam S the type of delimiter, usually char, char const * or string + * @param cont the container to join * @param delim delimiter used to glue together strings * @return a string containing input values concatenated with a delimiter */ @@ -217,8 +217,9 @@ string toMetricPrefixString( T const & value ); /** * @brief Compute the length of a constant string at compile-time. + * @param str The null-character terminated constant string + * @todo c++17: this function is to remove in favor of std::string_view */ -// TODO c++17: this function is to remove in favor of std::string_view constexpr size_t cstrlen( char const * const str ) { if( str ) From df1be470eee1a99a618fc8dff239c8140939f69f Mon Sep 17 00:00:00 2001 From: MelReyCG Date: Mon, 29 Jul 2024 12:29:32 +0200 Subject: [PATCH 12/24] =?UTF-8?q?=F0=9F=90=9B=20compil=20fix=20fix=20(dyna?= =?UTF-8?q?micCast)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../linearAlgebra/interfaces/trilinos/EpetraMatrix.cpp | 2 +- .../linearAlgebra/interfaces/trilinos/EpetraVector.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/coreComponents/linearAlgebra/interfaces/trilinos/EpetraMatrix.cpp b/src/coreComponents/linearAlgebra/interfaces/trilinos/EpetraMatrix.cpp index 9064b7ae12a..f82ed99375a 100644 --- a/src/coreComponents/linearAlgebra/interfaces/trilinos/EpetraMatrix.cpp +++ b/src/coreComponents/linearAlgebra/interfaces/trilinos/EpetraMatrix.cpp @@ -19,9 +19,9 @@ #include "EpetraMatrix.hpp" +#include "codingUtilities/RTTypes.hpp" #include "codingUtilities/Utilities.hpp" #include "linearAlgebra/interfaces/trilinos/EpetraUtils.hpp" -#include "RTTypes.hpp" #include #include diff --git a/src/coreComponents/linearAlgebra/interfaces/trilinos/EpetraVector.cpp b/src/coreComponents/linearAlgebra/interfaces/trilinos/EpetraVector.cpp index cb540f0053b..6677154ff47 100644 --- a/src/coreComponents/linearAlgebra/interfaces/trilinos/EpetraVector.cpp +++ b/src/coreComponents/linearAlgebra/interfaces/trilinos/EpetraVector.cpp @@ -19,9 +19,9 @@ #include "EpetraVector.hpp" +#include "codingUtilities/RTTypes.hpp" #include "codingUtilities/Utilities.hpp" #include "linearAlgebra/interfaces/trilinos/EpetraUtils.hpp" -#include "RTTypes.hpp" #include #include From 9bb911aec13842157746bfaed8bfb98af35dc9f6 Mon Sep 17 00:00:00 2001 From: MelReyCG Date: Mon, 29 Jul 2024 14:53:40 +0200 Subject: [PATCH 13/24] =?UTF-8?q?=F0=9F=93=9D=20docs=20fix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/coreComponents/common/format/StringUtilities.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/coreComponents/common/format/StringUtilities.hpp b/src/coreComponents/common/format/StringUtilities.hpp index b8e9eaf43b0..a03e44ac8ea 100644 --- a/src/coreComponents/common/format/StringUtilities.hpp +++ b/src/coreComponents/common/format/StringUtilities.hpp @@ -216,7 +216,7 @@ template< typename T > string toMetricPrefixString( T const & value ); /** - * @brief Compute the length of a constant string at compile-time. + * @return The length of a constant string computed at compile-time. * @param str The null-character terminated constant string * @todo c++17: this function is to remove in favor of std::string_view */ From 75b615615044f6ab660fee5a2da72d992ccf2a9c Mon Sep 17 00:00:00 2001 From: MelReyCG Date: Fri, 2 Aug 2024 15:04:45 +0200 Subject: [PATCH 14/24] Moving EnumStrings.hpp from codingUtilities to common/format --- src/coreComponents/codingUtilities/CMakeLists.txt | 1 - src/coreComponents/common/CMakeLists.txt | 1 + .../{codingUtilities => common/format}/EnumStrings.hpp | 8 ++++---- src/coreComponents/constitutive/ExponentialRelation.hpp | 2 +- .../capillaryPressure/JFunctionCapillaryPressure.hpp | 2 +- .../fluid/multifluid/CO2Brine/CO2BrineFluid.hpp | 2 +- .../multifluid/compositional/models/EquationOfState.hpp | 2 +- .../compositional/models/LohrenzBrayClarkViscosity.hpp | 2 +- .../fluid/multifluid/reactive/ReactiveBrineFluid.hpp | 2 +- .../fluid/multifluid/reactive/ReactiveMultiFluid.hpp | 2 +- .../constitutive/fluid/singlefluid/ParticleFluid.hpp | 2 +- .../relativePermeability/RelativePermeabilityBase.hpp | 2 +- src/coreComponents/dataRepository/ExecutableGroup.hpp | 2 +- .../fileIO/vtk/VTKPolyDataWriterInterface.hpp | 2 +- src/coreComponents/finiteElement/PDEUtilities.hpp | 2 +- .../functions/MultivariableTableFunction.hpp | 2 +- src/coreComponents/functions/TableFunction.hpp | 2 +- .../linearAlgebra/utilities/LinearSolverParameters.hpp | 2 +- src/coreComponents/mesh/ElementType.hpp | 2 +- src/coreComponents/mesh/MeshObjectPath.hpp | 2 +- src/coreComponents/mesh/ParticleType.hpp | 2 +- src/coreComponents/mesh/SurfaceElementRegion.hpp | 2 +- .../mesh/generators/InternalMeshGenerator.hpp | 2 +- .../mesh/generators/InternalWellboreGenerator.hpp | 2 +- .../mesh/generators/ParticleMeshGenerator.hpp | 2 +- .../physicsSolvers/NonlinearSolverParameters.hpp | 2 +- src/coreComponents/physicsSolvers/SolverBaseKernels.hpp | 2 +- .../physicsSolvers/contact/ContactFields.hpp | 2 +- .../physicsSolvers/fluidFlow/wells/WellControls.hpp | 2 +- .../physicsSolvers/inducedSeismicity/SeismicityRate.hpp | 2 +- .../physicsSolvers/simplePDE/LaplaceBaseH1.hpp | 2 +- .../solidMechanics/SolidMechanicsLagrangianFEM.hpp | 2 +- .../physicsSolvers/solidMechanics/SolidMechanicsMPM.hpp | 2 +- 33 files changed, 35 insertions(+), 35 deletions(-) rename src/coreComponents/{codingUtilities => common/format}/EnumStrings.hpp (97%) diff --git a/src/coreComponents/codingUtilities/CMakeLists.txt b/src/coreComponents/codingUtilities/CMakeLists.txt index a85e4046907..fecdf7d0cb7 100644 --- a/src/coreComponents/codingUtilities/CMakeLists.txt +++ b/src/coreComponents/codingUtilities/CMakeLists.txt @@ -2,7 +2,6 @@ # Specify all headers # set( codingUtilities_headers - EnumStrings.hpp RTTypes.hpp Parsing.hpp SFINAE_Macros.hpp diff --git a/src/coreComponents/common/CMakeLists.txt b/src/coreComponents/common/CMakeLists.txt index 2a5f70ff960..0b53f084cb6 100644 --- a/src/coreComponents/common/CMakeLists.txt +++ b/src/coreComponents/common/CMakeLists.txt @@ -6,6 +6,7 @@ set( common_headers format/table/TableLayout.hpp format/table/TableFormatter.hpp format/table/TableData.hpp + format/EnumStrings.hpp format/Format.hpp format/StringUtilities.hpp logger/Logger.hpp diff --git a/src/coreComponents/codingUtilities/EnumStrings.hpp b/src/coreComponents/common/format/EnumStrings.hpp similarity index 97% rename from src/coreComponents/codingUtilities/EnumStrings.hpp rename to src/coreComponents/common/format/EnumStrings.hpp index 40930b1b222..66ddd7e450d 100644 --- a/src/coreComponents/codingUtilities/EnumStrings.hpp +++ b/src/coreComponents/common/format/EnumStrings.hpp @@ -22,11 +22,11 @@ * of these strings, like stream insertion/extraction operators. */ -#ifndef GEOS_CODINGUTILITIES_ENUMSTRINGS_HPP -#define GEOS_CODINGUTILITIES_ENUMSTRINGS_HPP +#ifndef GEOS_COMMON_FORMAT_ENUMSTRINGS_HPP +#define GEOS_COMMON_FORMAT_ENUMSTRINGS_HPP #include "common/format/StringUtilities.hpp" -#include "codingUtilities/RTTypes.hpp" +// #include "codingUtilities/RTTypes.hpp" #include "common/DataTypes.hpp" #include "common/logger/Logger.hpp" #include "common/format/Format.hpp" @@ -209,4 +209,4 @@ struct GEOS_FMT_NS::formatter< Enum, std::enable_if_t< std::is_enum< Enum >::val } }; -#endif //GEOS_CODINGUTILITIES_ENUMSTRINGS_HPP +#endif //GEOS_COMMON_FORMAT_ENUMSTRINGS_HPP diff --git a/src/coreComponents/constitutive/ExponentialRelation.hpp b/src/coreComponents/constitutive/ExponentialRelation.hpp index ff0f197872a..4415b03d97d 100644 --- a/src/coreComponents/constitutive/ExponentialRelation.hpp +++ b/src/coreComponents/constitutive/ExponentialRelation.hpp @@ -21,7 +21,7 @@ #define GEOS_CONSITUTIVE_EXPONENTIALRELATION_HPP_ #include "common/DataTypes.hpp" -#include "codingUtilities/EnumStrings.hpp" +#include "common/format/EnumStrings.hpp" #include diff --git a/src/coreComponents/constitutive/capillaryPressure/JFunctionCapillaryPressure.hpp b/src/coreComponents/constitutive/capillaryPressure/JFunctionCapillaryPressure.hpp index 33395544d0c..22ef38d3af1 100644 --- a/src/coreComponents/constitutive/capillaryPressure/JFunctionCapillaryPressure.hpp +++ b/src/coreComponents/constitutive/capillaryPressure/JFunctionCapillaryPressure.hpp @@ -22,7 +22,7 @@ #include "constitutive/capillaryPressure/CapillaryPressureBase.hpp" -#include "codingUtilities/EnumStrings.hpp" +#include "common/format/EnumStrings.hpp" #include "functions/TableFunction.hpp" namespace geos diff --git a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/CO2BrineFluid.hpp b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/CO2BrineFluid.hpp index 2eec3526e92..f6b9875fa1a 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/CO2BrineFluid.hpp +++ b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/CO2BrineFluid.hpp @@ -20,7 +20,7 @@ #ifndef GEOS_CONSTITUTIVE_FLUID_MULTIFLUID_CO2BRINE_CO2BRINEFLUID_HPP_ #define GEOS_CONSTITUTIVE_FLUID_MULTIFLUID_CO2BRINE_CO2BRINEFLUID_HPP_ -#include "codingUtilities/EnumStrings.hpp" +#include "common/format/EnumStrings.hpp" #include "constitutive/fluid/multifluid/MultiFluidBase.hpp" #include "constitutive/fluid/multifluid/MultiFluidUtils.hpp" #include "constitutive/fluid/multifluid/CO2Brine/PhaseModel.hpp" diff --git a/src/coreComponents/constitutive/fluid/multifluid/compositional/models/EquationOfState.hpp b/src/coreComponents/constitutive/fluid/multifluid/compositional/models/EquationOfState.hpp index 40ba0fb80a3..779001d22dd 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/compositional/models/EquationOfState.hpp +++ b/src/coreComponents/constitutive/fluid/multifluid/compositional/models/EquationOfState.hpp @@ -23,7 +23,7 @@ #include "ModelParameters.hpp" #include "constitutive/fluid/multifluid/MultiFluidBase.hpp" #include "dataRepository/InputFlags.hpp" -#include "codingUtilities/EnumStrings.hpp" +#include "common/format/EnumStrings.hpp" namespace geos { diff --git a/src/coreComponents/constitutive/fluid/multifluid/compositional/models/LohrenzBrayClarkViscosity.hpp b/src/coreComponents/constitutive/fluid/multifluid/compositional/models/LohrenzBrayClarkViscosity.hpp index 3767a0d049e..62408a75d78 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/compositional/models/LohrenzBrayClarkViscosity.hpp +++ b/src/coreComponents/constitutive/fluid/multifluid/compositional/models/LohrenzBrayClarkViscosity.hpp @@ -22,7 +22,7 @@ #include "FunctionBase.hpp" -#include "codingUtilities/EnumStrings.hpp" +#include "common/format/EnumStrings.hpp" namespace geos { diff --git a/src/coreComponents/constitutive/fluid/multifluid/reactive/ReactiveBrineFluid.hpp b/src/coreComponents/constitutive/fluid/multifluid/reactive/ReactiveBrineFluid.hpp index bf7040d8cb4..6dcf1f4f3ce 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/reactive/ReactiveBrineFluid.hpp +++ b/src/coreComponents/constitutive/fluid/multifluid/reactive/ReactiveBrineFluid.hpp @@ -20,7 +20,7 @@ #ifndef GEOS_CONSTITUTIVE_FLUID_REACTIVEBRINEFLUID_HPP_ #define GEOS_CONSTITUTIVE_FLUID_REACTIVEBRINEFLUID_HPP_ -#include "codingUtilities/EnumStrings.hpp" +#include "common/format/EnumStrings.hpp" #include "constitutive/fluid/multifluid/reactive/ReactiveMultiFluid.hpp" #include "constitutive/fluid/multifluid/MultiFluidUtils.hpp" #include "constitutive/fluid/multifluid/CO2Brine/PhaseModel.hpp" diff --git a/src/coreComponents/constitutive/fluid/multifluid/reactive/ReactiveMultiFluid.hpp b/src/coreComponents/constitutive/fluid/multifluid/reactive/ReactiveMultiFluid.hpp index 4fd8f6c9fb3..ce73df5a640 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/reactive/ReactiveMultiFluid.hpp +++ b/src/coreComponents/constitutive/fluid/multifluid/reactive/ReactiveMultiFluid.hpp @@ -21,7 +21,7 @@ #define GEOS_CONSTITUTIVE_FLUID_MULTIFLUID_REACTIVE_REACTIVEMULTIFLUID_HPP_ -#include "codingUtilities/EnumStrings.hpp" +#include "common/format/EnumStrings.hpp" #include "constitutive/fluid/multifluid/MultiFluidBase.hpp" #include "constitutive/fluid/multifluid/reactive/chemicalReactions/EquilibriumReactions.hpp" #include "constitutive/fluid/multifluid/reactive/chemicalReactions/KineticReactions.hpp" diff --git a/src/coreComponents/constitutive/fluid/singlefluid/ParticleFluid.hpp b/src/coreComponents/constitutive/fluid/singlefluid/ParticleFluid.hpp index 76579665d1f..714550b09c4 100644 --- a/src/coreComponents/constitutive/fluid/singlefluid/ParticleFluid.hpp +++ b/src/coreComponents/constitutive/fluid/singlefluid/ParticleFluid.hpp @@ -20,7 +20,7 @@ #ifndef GEOS_CONSTITUTIVE_FLUID_SINGLEFLUID_PARTICLEFLUID_HPP_ #define GEOS_CONSTITUTIVE_FLUID_SINGLEFLUID_PARTICLEFLUID_HPP_ -#include "codingUtilities/EnumStrings.hpp" +#include "common/format/EnumStrings.hpp" #include "constitutive/fluid/singlefluid/ParticleFluidBase.hpp" namespace geos diff --git a/src/coreComponents/constitutive/relativePermeability/RelativePermeabilityBase.hpp b/src/coreComponents/constitutive/relativePermeability/RelativePermeabilityBase.hpp index 00f8f9a5be1..dbe9686103e 100644 --- a/src/coreComponents/constitutive/relativePermeability/RelativePermeabilityBase.hpp +++ b/src/coreComponents/constitutive/relativePermeability/RelativePermeabilityBase.hpp @@ -24,7 +24,7 @@ #include "constitutive/ConstitutiveBase.hpp" #include "constitutive/relativePermeability/layouts.hpp" #include "common/GEOS_RAJA_Interface.hpp" -#include "codingUtilities/EnumStrings.hpp" +#include "common/format/EnumStrings.hpp" namespace geos { diff --git a/src/coreComponents/dataRepository/ExecutableGroup.hpp b/src/coreComponents/dataRepository/ExecutableGroup.hpp index ae183dd5d80..7bcd7f8da3c 100644 --- a/src/coreComponents/dataRepository/ExecutableGroup.hpp +++ b/src/coreComponents/dataRepository/ExecutableGroup.hpp @@ -20,7 +20,7 @@ #ifndef GEOS_DATAREPOSITORY_EXECUTABLEGROUP_HPP_ #define GEOS_DATAREPOSITORY_EXECUTABLEGROUP_HPP_ -#include "codingUtilities/EnumStrings.hpp" +#include "common/format/EnumStrings.hpp" #include "common/DataTypes.hpp" #include "Group.hpp" diff --git a/src/coreComponents/fileIO/vtk/VTKPolyDataWriterInterface.hpp b/src/coreComponents/fileIO/vtk/VTKPolyDataWriterInterface.hpp index 7ddc67d730c..36020342b49 100644 --- a/src/coreComponents/fileIO/vtk/VTKPolyDataWriterInterface.hpp +++ b/src/coreComponents/fileIO/vtk/VTKPolyDataWriterInterface.hpp @@ -21,7 +21,7 @@ #include "dataRepository/Wrapper.hpp" #include "fileIO/vtk/VTKPVDWriter.hpp" #include "fileIO/vtk/VTKVTMWriter.hpp" -#include "codingUtilities/EnumStrings.hpp" +#include "common/format/EnumStrings.hpp" class vtkUnstructuredGrid; class vtkPointData; diff --git a/src/coreComponents/finiteElement/PDEUtilities.hpp b/src/coreComponents/finiteElement/PDEUtilities.hpp index a834df8048b..8a9c5101d42 100644 --- a/src/coreComponents/finiteElement/PDEUtilities.hpp +++ b/src/coreComponents/finiteElement/PDEUtilities.hpp @@ -20,7 +20,7 @@ #ifndef GEOS_FINITEELEMENT_PDEUTILITIES_HPP_ #define GEOS_FINITEELEMENT_PDEUTILITIES_HPP_ -#include "codingUtilities/EnumStrings.hpp" +#include "common/format/EnumStrings.hpp" namespace geos { diff --git a/src/coreComponents/functions/MultivariableTableFunction.hpp b/src/coreComponents/functions/MultivariableTableFunction.hpp index 37660da0751..87e3d1ed3d9 100644 --- a/src/coreComponents/functions/MultivariableTableFunction.hpp +++ b/src/coreComponents/functions/MultivariableTableFunction.hpp @@ -22,7 +22,7 @@ #include "FunctionBase.hpp" -#include "codingUtilities/EnumStrings.hpp" +#include "common/format/EnumStrings.hpp" #include "LvArray/src/tensorOps.hpp" namespace geos diff --git a/src/coreComponents/functions/TableFunction.hpp b/src/coreComponents/functions/TableFunction.hpp index 94c4b25f777..9038a4d456b 100644 --- a/src/coreComponents/functions/TableFunction.hpp +++ b/src/coreComponents/functions/TableFunction.hpp @@ -22,7 +22,7 @@ #include "FunctionBase.hpp" -#include "codingUtilities/EnumStrings.hpp" +#include "common/format/EnumStrings.hpp" #include "LvArray/src/tensorOps.hpp" #include "common/Units.hpp" diff --git a/src/coreComponents/linearAlgebra/utilities/LinearSolverParameters.hpp b/src/coreComponents/linearAlgebra/utilities/LinearSolverParameters.hpp index 722b6b4d3e1..05716f7700f 100644 --- a/src/coreComponents/linearAlgebra/utilities/LinearSolverParameters.hpp +++ b/src/coreComponents/linearAlgebra/utilities/LinearSolverParameters.hpp @@ -20,7 +20,7 @@ #ifndef GEOS_LINEARALGEBRA_UTILITIES_LINEARSOLVERPARAMETERS_HPP_ #define GEOS_LINEARALGEBRA_UTILITIES_LINEARSOLVERPARAMETERS_HPP_ -#include "codingUtilities/EnumStrings.hpp" +#include "common/format/EnumStrings.hpp" namespace geos { diff --git a/src/coreComponents/mesh/ElementType.hpp b/src/coreComponents/mesh/ElementType.hpp index 5db51d7e319..f241f534be8 100644 --- a/src/coreComponents/mesh/ElementType.hpp +++ b/src/coreComponents/mesh/ElementType.hpp @@ -20,7 +20,7 @@ #ifndef GEOS_MESH_ELEMENTTYPE_HPP #define GEOS_MESH_ELEMENTTYPE_HPP -#include "codingUtilities/EnumStrings.hpp" +#include "common/format/EnumStrings.hpp" namespace geos { diff --git a/src/coreComponents/mesh/MeshObjectPath.hpp b/src/coreComponents/mesh/MeshObjectPath.hpp index 0586e47821f..ffcf9101d6b 100644 --- a/src/coreComponents/mesh/MeshObjectPath.hpp +++ b/src/coreComponents/mesh/MeshObjectPath.hpp @@ -21,7 +21,7 @@ #define GEOS_MESH_MESHOBJECTPATH_HPP_ -#include "codingUtilities/EnumStrings.hpp" +#include "common/format/EnumStrings.hpp" #include "MeshLevel.hpp" namespace geos diff --git a/src/coreComponents/mesh/ParticleType.hpp b/src/coreComponents/mesh/ParticleType.hpp index da32741848e..4eaa4f0b7ed 100644 --- a/src/coreComponents/mesh/ParticleType.hpp +++ b/src/coreComponents/mesh/ParticleType.hpp @@ -20,7 +20,7 @@ #ifndef GEOS_MESH_PARTICLETYPE_HPP #define GEOS_MESH_PARTICLETYPE_HPP -#include "codingUtilities/EnumStrings.hpp" +#include "common/format/EnumStrings.hpp" namespace geos { diff --git a/src/coreComponents/mesh/SurfaceElementRegion.hpp b/src/coreComponents/mesh/SurfaceElementRegion.hpp index f011e6ebf45..7925528567f 100644 --- a/src/coreComponents/mesh/SurfaceElementRegion.hpp +++ b/src/coreComponents/mesh/SurfaceElementRegion.hpp @@ -22,7 +22,7 @@ #define GEOS_MESH_SURFACEELEMENTREGION_HPP_ #include "ElementRegionBase.hpp" -#include "codingUtilities/EnumStrings.hpp" +#include "common/format/EnumStrings.hpp" namespace geos { diff --git a/src/coreComponents/mesh/generators/InternalMeshGenerator.hpp b/src/coreComponents/mesh/generators/InternalMeshGenerator.hpp index 50b23142d8f..eb7c2953943 100644 --- a/src/coreComponents/mesh/generators/InternalMeshGenerator.hpp +++ b/src/coreComponents/mesh/generators/InternalMeshGenerator.hpp @@ -20,7 +20,7 @@ #ifndef GEOS_MESH_GENERATORS_INTERNALMESHGENERATOR_HPP #define GEOS_MESH_GENERATORS_INTERNALMESHGENERATOR_HPP -#include "codingUtilities/EnumStrings.hpp" +#include "common/format/EnumStrings.hpp" #include "mesh/generators/MeshGeneratorBase.hpp" #include "mesh/generators/CellBlockManager.hpp" #include "mesh/mpiCommunications/SpatialPartition.hpp" diff --git a/src/coreComponents/mesh/generators/InternalWellboreGenerator.hpp b/src/coreComponents/mesh/generators/InternalWellboreGenerator.hpp index 22061da1536..10e6fdf751d 100644 --- a/src/coreComponents/mesh/generators/InternalWellboreGenerator.hpp +++ b/src/coreComponents/mesh/generators/InternalWellboreGenerator.hpp @@ -20,7 +20,7 @@ #ifndef GEOS_MESHUTILITIES_INTERNALWELLBOREGENERATOR_HPP #define GEOS_MESHUTILITIES_INTERNALWELLBOREGENERATOR_HPP -#include "codingUtilities/EnumStrings.hpp" +#include "common/format/EnumStrings.hpp" #include "dataRepository/Group.hpp" #include "InternalMeshGenerator.hpp" diff --git a/src/coreComponents/mesh/generators/ParticleMeshGenerator.hpp b/src/coreComponents/mesh/generators/ParticleMeshGenerator.hpp index 9d9209de82e..299b00b92f1 100644 --- a/src/coreComponents/mesh/generators/ParticleMeshGenerator.hpp +++ b/src/coreComponents/mesh/generators/ParticleMeshGenerator.hpp @@ -22,7 +22,7 @@ #include "mesh/generators/MeshGeneratorBase.hpp" -#include "codingUtilities/EnumStrings.hpp" +#include "common/format/EnumStrings.hpp" namespace geos { diff --git a/src/coreComponents/physicsSolvers/NonlinearSolverParameters.hpp b/src/coreComponents/physicsSolvers/NonlinearSolverParameters.hpp index 98bdcce95a8..652ea8ad3d0 100644 --- a/src/coreComponents/physicsSolvers/NonlinearSolverParameters.hpp +++ b/src/coreComponents/physicsSolvers/NonlinearSolverParameters.hpp @@ -16,7 +16,7 @@ #ifndef GEOS_PHYSICSSOLVERS_NONLINEARSOLVERPARAMETERS_HPP_ #define GEOS_PHYSICSSOLVERS_NONLINEARSOLVERPARAMETERS_HPP_ -#include "codingUtilities/EnumStrings.hpp" +#include "common/format/EnumStrings.hpp" #include "dataRepository/Group.hpp" #include "physicsSolvers/SolverBaseKernels.hpp" diff --git a/src/coreComponents/physicsSolvers/SolverBaseKernels.hpp b/src/coreComponents/physicsSolvers/SolverBaseKernels.hpp index 7b12943aaca..ff36b20ff76 100644 --- a/src/coreComponents/physicsSolvers/SolverBaseKernels.hpp +++ b/src/coreComponents/physicsSolvers/SolverBaseKernels.hpp @@ -20,7 +20,7 @@ #ifndef GEOS_PHYSICSSOLVERS_SOLVERBASEKERNELS_HPP #define GEOS_PHYSICSSOLVERS_SOLVERBASEKERNELS_HPP -#include "codingUtilities/EnumStrings.hpp" +#include "common/format/EnumStrings.hpp" #include "common/DataTypes.hpp" #include "common/MpiWrapper.hpp" diff --git a/src/coreComponents/physicsSolvers/contact/ContactFields.hpp b/src/coreComponents/physicsSolvers/contact/ContactFields.hpp index f0d57887244..23c7aad2e2a 100644 --- a/src/coreComponents/physicsSolvers/contact/ContactFields.hpp +++ b/src/coreComponents/physicsSolvers/contact/ContactFields.hpp @@ -21,7 +21,7 @@ #define GEOS_PHYSICSSOLVERS_CONTACT_CONTACTFIELDS_HPP_ #include "mesh/MeshFields.hpp" -#include "codingUtilities/EnumStrings.hpp" +#include "common/format/EnumStrings.hpp" namespace geos { diff --git a/src/coreComponents/physicsSolvers/fluidFlow/wells/WellControls.hpp b/src/coreComponents/physicsSolvers/fluidFlow/wells/WellControls.hpp index 2089d45ddbb..9989f4f4810 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/wells/WellControls.hpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/wells/WellControls.hpp @@ -21,7 +21,7 @@ #ifndef GEOS_PHYSICSSOLVERS_FLUIDFLOW_WELLS_WELLCONTROLS_HPP #define GEOS_PHYSICSSOLVERS_FLUIDFLOW_WELLS_WELLCONTROLS_HPP -#include "codingUtilities/EnumStrings.hpp" +#include "common/format/EnumStrings.hpp" #include "dataRepository/Group.hpp" #include "functions/TableFunction.hpp" diff --git a/src/coreComponents/physicsSolvers/inducedSeismicity/SeismicityRate.hpp b/src/coreComponents/physicsSolvers/inducedSeismicity/SeismicityRate.hpp index eb49f9270a7..e7e0011043c 100644 --- a/src/coreComponents/physicsSolvers/inducedSeismicity/SeismicityRate.hpp +++ b/src/coreComponents/physicsSolvers/inducedSeismicity/SeismicityRate.hpp @@ -16,7 +16,7 @@ #ifndef GEOS_PHYSICSSOLVERS_INDUCED_SEISMICITY_SEISMICITYRATE_HPP #define GEOS_PHYSICSSOLVERS_INDUCED_SEISMICITY_SEISMICITYRATE_HPP -#include "codingUtilities/EnumStrings.hpp" // facilities for enum-string conversion (for reading enum values from XML input) +#include "common/format/EnumStrings.hpp" // facilities for enum-string conversion (for reading enum values from XML input) #include "physicsSolvers/SolverBase.hpp" // an abstraction class shared by all physics solvers #include "fieldSpecification/FieldSpecificationManager.hpp" // a manager that can access and set values on the discretized domain diff --git a/src/coreComponents/physicsSolvers/simplePDE/LaplaceBaseH1.hpp b/src/coreComponents/physicsSolvers/simplePDE/LaplaceBaseH1.hpp index 9b3b6b20735..68db594bc15 100644 --- a/src/coreComponents/physicsSolvers/simplePDE/LaplaceBaseH1.hpp +++ b/src/coreComponents/physicsSolvers/simplePDE/LaplaceBaseH1.hpp @@ -16,7 +16,7 @@ #ifndef GEOS_PHYSICSSOLVERS_SIMPLEPDE_LAPLACE_BASE_HPP #define GEOS_PHYSICSSOLVERS_SIMPLEPDE_LAPLACE_BASE_HPP -#include "codingUtilities/EnumStrings.hpp" // facilities for enum-string conversion (for reading enum values from XML input) +#include "common/format/EnumStrings.hpp" // facilities for enum-string conversion (for reading enum values from XML input) #include "physicsSolvers/SolverBase.hpp" // an abstraction class shared by all physics solvers #include "fieldSpecification/FieldSpecificationManager.hpp" // a manager that can access and set values on the discretized domain diff --git a/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsLagrangianFEM.hpp b/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsLagrangianFEM.hpp index 9deae4f3272..c8816624199 100644 --- a/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsLagrangianFEM.hpp +++ b/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsLagrangianFEM.hpp @@ -20,7 +20,7 @@ #ifndef GEOS_PHYSICSSOLVERS_SOLIDMECHANICS_SOLIDMECHANICSLAGRANGIANFEM_HPP_ #define GEOS_PHYSICSSOLVERS_SOLIDMECHANICS_SOLIDMECHANICSLAGRANGIANFEM_HPP_ -#include "codingUtilities/EnumStrings.hpp" +#include "common/format/EnumStrings.hpp" #include "common/TimingMacros.hpp" #include "kernels/SolidMechanicsLagrangianFEMKernels.hpp" #include "kernels/StrainHelper.hpp" diff --git a/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsMPM.hpp b/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsMPM.hpp index 51de54a2d30..1bcd39991a9 100644 --- a/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsMPM.hpp +++ b/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsMPM.hpp @@ -20,7 +20,7 @@ #ifndef GEOS_PHYSICSSOLVERS_SOLIDMECHANICS_MPM_HPP_ #define GEOS_PHYSICSSOLVERS_SOLIDMECHANICS_MPM_HPP_ -#include "codingUtilities/EnumStrings.hpp" +#include "common/format/EnumStrings.hpp" #include "common/TimingMacros.hpp" #include "kernels/SolidMechanicsLagrangianFEMKernels.hpp" #include "kernels/ExplicitMPM.hpp" From 8d673e69fb7bbf3d4dff685440935f7b57da02f4 Mon Sep 17 00:00:00 2001 From: MelReyCG Date: Fri, 2 Aug 2024 15:12:29 +0200 Subject: [PATCH 15/24] moving the regex in codingUtilities as it is related to rtTypes / regexes --- .../codingUtilities/RTTypes.hpp | 25 +++++++++++++++++++ .../common/format/EnumStrings.hpp | 17 ------------- 2 files changed, 25 insertions(+), 17 deletions(-) diff --git a/src/coreComponents/codingUtilities/RTTypes.hpp b/src/coreComponents/codingUtilities/RTTypes.hpp index a94c6cb8236..f16a33aaeb2 100644 --- a/src/coreComponents/codingUtilities/RTTypes.hpp +++ b/src/coreComponents/codingUtilities/RTTypes.hpp @@ -24,6 +24,7 @@ #define GEOS_CODINGUTILITIES_RTTYPES_HPP #include "common/DataTypes.hpp" +#include "common/format/EnumStrings.hpp" #include "common/format/Format.hpp" #include "common/logger/Logger.hpp" @@ -232,6 +233,30 @@ struct TypeName } }; +/** + * @brief Base types TypeRegex specializations + */ +///@{ + +/** + * @brief Specialization of TypeRegex for enumeration types with strings attached (pun intended). + * @tparam ENUM the type of enumeration + */ +template< typename ENUM > +struct TypeRegex< ENUM, std::enable_if_t< internal::HasEnumStrings< ENUM > > > +{ + /** + * @brief @return Regex for validating enumeration inputs for @p ENUM type. + */ + static Regex get() + { + return Regex( EnumStrings< ENUM >::concat( "|" ), + "Input value must be one of { " + EnumStrings< ENUM >::concat( ", " ) + "}." ); + } +}; + +///@} + } diff --git a/src/coreComponents/common/format/EnumStrings.hpp b/src/coreComponents/common/format/EnumStrings.hpp index 66ddd7e450d..5c332324923 100644 --- a/src/coreComponents/common/format/EnumStrings.hpp +++ b/src/coreComponents/common/format/EnumStrings.hpp @@ -166,23 +166,6 @@ namespace internal IS_VALID_EXPRESSION( HasEnumStrings, ENUM, getEnumStrings( std::declval< ENUM >() ) ); } -/** - * @brief Specialization of TypeRegex for enumeration types with strings attached (pun intended). - * @tparam ENUM the type of enumeration - */ -template< typename ENUM > -struct TypeRegex< ENUM, std::enable_if_t< internal::HasEnumStrings< ENUM > > > -{ - /** - * @brief @return Regex for validating enumeration inputs for @p ENUM type. - */ - static Regex get() - { - return Regex( EnumStrings< ENUM >::concat( "|" ), - "Input value must be one of { " + EnumStrings< ENUM >::concat( ", " ) + "}." ); - } -}; - } // namespace geos // Formatter specialization for enums From bb14d9a9d30430ec315d6f5e51e7d2c50e38f15e Mon Sep 17 00:00:00 2001 From: MelReyCG Date: Fri, 2 Aug 2024 15:49:37 +0200 Subject: [PATCH 16/24] adding docs --- src/coreComponents/common/format/EnumStrings.hpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/coreComponents/common/format/EnumStrings.hpp b/src/coreComponents/common/format/EnumStrings.hpp index 5c332324923..1c98b003bb6 100644 --- a/src/coreComponents/common/format/EnumStrings.hpp +++ b/src/coreComponents/common/format/EnumStrings.hpp @@ -66,6 +66,16 @@ constexpr int countArgs( ARGS ... ) * may be used to get access to strings at runtime. While not strictly necessary, * it is recommended that macro call immediately follows the enum definition * (or the class definition, if enum is defined inside a class). + * + * @example + * enum struct VTKOutputMode + * { + * BINARY, + * ASCII + * }; + * ENUM_STRINGS( VTKOutputMode, + * "binary", + * "ascii" ); */ #define ENUM_STRINGS( ENUM, ... ) \ inline auto const & getEnumStrings( ENUM const ) \ From 9ab5f99ae79789fa4af9b405345896089fa694aa Mon Sep 17 00:00:00 2001 From: MelReyCG Date: Fri, 2 Aug 2024 15:50:00 +0200 Subject: [PATCH 17/24] removing dependency with TypeName --- src/coreComponents/common/format/EnumStrings.hpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/coreComponents/common/format/EnumStrings.hpp b/src/coreComponents/common/format/EnumStrings.hpp index 1c98b003bb6..9369e035241 100644 --- a/src/coreComponents/common/format/EnumStrings.hpp +++ b/src/coreComponents/common/format/EnumStrings.hpp @@ -84,6 +84,11 @@ constexpr int countArgs( ARGS ... ) return ss; \ } \ \ + inline auto const & getEnumTypeNameString( ENUM const ) \ + { \ + return #ENUM; \ + } \ + \ inline std::ostream & operator<<( std::ostream & os, ENUM const e ) \ { \ os << EnumStrings< ENUM >::toString( e ); \ @@ -149,7 +154,7 @@ struct EnumStrings std::size_t size = std::distance( std::begin( strings ), std::end( strings ) ); base_type const index = static_cast< base_type >( e ); GEOS_THROW_IF( index >= LvArray::integerConversion< base_type >( size ), - "Invalid value " << index << " of type " << TypeName< ENUM >::brief() << ". Valid range is 0.." << size - 1, + "Invalid value " << index << " of type " << getEnumTypeNameString( enum_type{} ) << ". Valid range is 0.." << size - 1, InputError ); return strings[ index ]; } @@ -164,7 +169,7 @@ struct EnumStrings auto const & strings = get(); auto const it = std::find( std::begin( strings ), std::end( strings ), s ); GEOS_THROW_IF( it == std::end( strings ), - "Invalid value '" << s << "' of type " << TypeName< enum_type >::brief() << ". Valid options are: " << concat( ", " ), + "Invalid value '" << s << "' of type " << getEnumTypeNameString( enum_type{} ) << ". Valid options are: " << concat( ", " ), InputError ); enum_type const e = static_cast< enum_type >( LvArray::integerConversion< base_type >( std::distance( std::begin( strings ), it ) ) ); return e; From de439f46c8b9e96ba5eb276661994acba3fd3828 Mon Sep 17 00:00:00 2001 From: MelReyCG Date: Fri, 2 Aug 2024 16:24:32 +0200 Subject: [PATCH 18/24] uncrustify --- src/coreComponents/common/format/EnumStrings.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/coreComponents/common/format/EnumStrings.hpp b/src/coreComponents/common/format/EnumStrings.hpp index 9369e035241..c231046d912 100644 --- a/src/coreComponents/common/format/EnumStrings.hpp +++ b/src/coreComponents/common/format/EnumStrings.hpp @@ -66,7 +66,7 @@ constexpr int countArgs( ARGS ... ) * may be used to get access to strings at runtime. While not strictly necessary, * it is recommended that macro call immediately follows the enum definition * (or the class definition, if enum is defined inside a class). - * + * * @example * enum struct VTKOutputMode * { From 8950ad2a0a9232a3978c9b02d61693a8f5cfa83d Mon Sep 17 00:00:00 2001 From: MelReyCG Date: Fri, 2 Aug 2024 17:28:30 +0200 Subject: [PATCH 19/24] docs bugfix --- src/coreComponents/common/format/EnumStrings.hpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/coreComponents/common/format/EnumStrings.hpp b/src/coreComponents/common/format/EnumStrings.hpp index c231046d912..42e02825421 100644 --- a/src/coreComponents/common/format/EnumStrings.hpp +++ b/src/coreComponents/common/format/EnumStrings.hpp @@ -66,7 +66,6 @@ constexpr int countArgs( ARGS ... ) * may be used to get access to strings at runtime. While not strictly necessary, * it is recommended that macro call immediately follows the enum definition * (or the class definition, if enum is defined inside a class). - * * @example * enum struct VTKOutputMode * { From d87eae38f9e049f77fa0137df0694ead3d99e77f Mon Sep 17 00:00:00 2001 From: MelReyCG Date: Mon, 19 Aug 2024 10:17:56 +0200 Subject: [PATCH 20/24] "@example" is not supported? --- src/coreComponents/common/format/EnumStrings.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/coreComponents/common/format/EnumStrings.hpp b/src/coreComponents/common/format/EnumStrings.hpp index 42e02825421..ba5c86aa889 100644 --- a/src/coreComponents/common/format/EnumStrings.hpp +++ b/src/coreComponents/common/format/EnumStrings.hpp @@ -66,7 +66,7 @@ constexpr int countArgs( ARGS ... ) * may be used to get access to strings at runtime. While not strictly necessary, * it is recommended that macro call immediately follows the enum definition * (or the class definition, if enum is defined inside a class). - * @example + * * enum struct VTKOutputMode * { * BINARY, From 355eda65904e1ac04c469f1cae93d886f0ecd846 Mon Sep 17 00:00:00 2001 From: MelReyCG Date: Tue, 20 Aug 2024 11:34:28 +0200 Subject: [PATCH 21/24] forgotten impacted files PR ##3278 --- .../fractureFlow_conforming_2d_vtk_input.xml | 5 +++-- .../schema/docs/HydraulicApertureTable.rst | 12 ++++++++++++ .../schema/docs/HydraulicApertureTable_other.rst | 9 +++++++++ src/coreComponents/schema/docs/VTKMesh.rst | 4 ++-- src/coreComponents/schema/schema.xsd | 8 ++++---- 5 files changed, 30 insertions(+), 8 deletions(-) create mode 100644 src/coreComponents/schema/docs/HydraulicApertureTable.rst create mode 100644 src/coreComponents/schema/docs/HydraulicApertureTable_other.rst diff --git a/inputFiles/singlePhaseFlowFractures/fractureFlow_conforming_2d_vtk_input.xml b/inputFiles/singlePhaseFlowFractures/fractureFlow_conforming_2d_vtk_input.xml index 4b77e706571..c59fbc223cb 100644 --- a/inputFiles/singlePhaseFlowFractures/fractureFlow_conforming_2d_vtk_input.xml +++ b/inputFiles/singlePhaseFlowFractures/fractureFlow_conforming_2d_vtk_input.xml @@ -1,6 +1,7 @@ - + - - + + @@ -1711,8 +1711,8 @@ stress - traction is applied to the faces as specified by the inner product of i - - + + From af62b51e0f384a665f1714ce268021cf356e7bd8 Mon Sep 17 00:00:00 2001 From: MelReyCG Date: Tue, 27 Aug 2024 11:20:33 +0200 Subject: [PATCH 22/24] removing schema call --- .../fractureFlow_conforming_2d_vtk_input.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/inputFiles/singlePhaseFlowFractures/fractureFlow_conforming_2d_vtk_input.xml b/inputFiles/singlePhaseFlowFractures/fractureFlow_conforming_2d_vtk_input.xml index 77ff5101fee..a6f20653665 100644 --- a/inputFiles/singlePhaseFlowFractures/fractureFlow_conforming_2d_vtk_input.xml +++ b/inputFiles/singlePhaseFlowFractures/fractureFlow_conforming_2d_vtk_input.xml @@ -1,7 +1,6 @@ - + Date: Mon, 21 Oct 2024 15:13:18 +0200 Subject: [PATCH 23/24] merge fix --- src/coreComponents/dataRepository/unitTests/testXmlWrapper.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/coreComponents/dataRepository/unitTests/testXmlWrapper.cpp b/src/coreComponents/dataRepository/unitTests/testXmlWrapper.cpp index 32141eb0e28..ce1dbaf3e7e 100644 --- a/src/coreComponents/dataRepository/unitTests/testXmlWrapper.cpp +++ b/src/coreComponents/dataRepository/unitTests/testXmlWrapper.cpp @@ -16,7 +16,7 @@ #include #include "dataRepository/xmlWrapper.hpp" -#include "codingUtilities/EnumStrings.hpp" +#include "common/format/EnumStrings.hpp" using namespace geos; From 7f5220ff5a088c3fc555eb3cfb0823ff28a72d9a Mon Sep 17 00:00:00 2001 From: MelReyCG Date: Fri, 8 Nov 2024 09:59:18 +0100 Subject: [PATCH 24/24] generated schema --- src/coreComponents/schema/schema.xsd | 51 ++++++++++++++++++++-- src/coreComponents/schema/schema.xsd.other | 39 +++++++++++------ 2 files changed, 72 insertions(+), 18 deletions(-) diff --git a/src/coreComponents/schema/schema.xsd b/src/coreComponents/schema/schema.xsd index 6150e54825e..be068727a02 100644 --- a/src/coreComponents/schema/schema.xsd +++ b/src/coreComponents/schema/schema.xsd @@ -965,7 +965,7 @@ - + @@ -2325,12 +2325,16 @@ Level 0 outputs no specific information for this solver. Higher levels require m + + + + @@ -2406,12 +2410,16 @@ Level 0 outputs no specific information for this solver. Higher levels require m + + + + @@ -2477,12 +2485,16 @@ Level 0 outputs no specific information for this solver. Higher levels require m + + + + @@ -2934,12 +2946,16 @@ Level 0 outputs no specific information for this solver. Higher levels require m + + + + @@ -3009,12 +3025,16 @@ Level 0 outputs no specific information for this solver. Higher levels require m + + + + @@ -3427,18 +3447,31 @@ Level 0 outputs no specific information for this solver. Higher levels require m + + - + - - + + @@ -6054,6 +6087,16 @@ If you want to do a three-phase simulation, please use instead wettingIntermedia + + + + + + + + + + diff --git a/src/coreComponents/schema/schema.xsd.other b/src/coreComponents/schema/schema.xsd.other index 3a9252a6e69..8327ee3789c 100644 --- a/src/coreComponents/schema/schema.xsd.other +++ b/src/coreComponents/schema/schema.xsd.other @@ -615,8 +615,8 @@ - - + + @@ -662,8 +662,8 @@ - - + + @@ -703,8 +703,8 @@ - - + + @@ -837,8 +837,8 @@ - - + + @@ -884,8 +884,8 @@ - - + + @@ -1008,12 +1008,10 @@ - - - + @@ -2587,7 +2585,20 @@ - + + + + + + + + + + + + + +