Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/coreComponents/codingUtilities/RTTypes.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ class rtTypes
/**
* @brief the regex map type to store and find the regexes by the associated rtTypeName.
*/
using RegexMapType = std::map< string, Regex >;
using RegexMapType = stdMap< string, Regex >;

/**
* @brief Custom types are useful to customize the regexes of an existing type. The type name
Expand Down
14 changes: 7 additions & 7 deletions src/coreComponents/codingUtilities/tests/testGeosxTraits.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ TEST( testGeosxTraits, HasMemberFunction_at )
static_assert( HasMemberFunction_at< string >, "Should be true." );
static_assert( HasMemberFunction_at< stdVector< int > >, "Should be true." );
static_assert( HasMemberFunction_at< stdVector< double > >, "Should be true." );
static_assert( HasMemberFunction_at< std::map< int, string > >, "Should be true." );
static_assert( HasMemberFunction_at< stdMap< int, string > >, "Should be true." );
static_assert( HasMemberFunction_at< std::unordered_map< int, string > >, "Should be true." );

static_assert( !HasMemberFunction_at< int >, "Should be false." );
static_assert( !HasMemberFunction_at< std::map< string, string > >, "Should be false." );
static_assert( !HasMemberFunction_at< stdMap< string, string > >, "Should be false." );
static_assert( !HasMemberFunction_at< array1d< localIndex > >, "Should be false." );
}

Expand All @@ -66,7 +66,7 @@ HAS_MEMBER_FUNCTION_NO_RTYPE( insert,
TEST( testGeosxTraits, HasMemberFunction_insert )
{
static_assert( HasMemberFunction_insert< stdVector< int > >, "Should be true." );
static_assert( HasMemberFunction_insert< std::map< string, int > >, "Should be true." );
static_assert( HasMemberFunction_insert< stdMap< string, int > >, "Should be true." );
static_assert( HasMemberFunction_insert< std::list< stdVector< int > > >, "Should be true." );

static_assert( !HasMemberFunction_insert< int >, "Should be false." );
Expand All @@ -79,7 +79,7 @@ TEST( testGeosxTraits, HasAlias_value_type )
static_assert( HasAlias_value_type< array1d< double > >, "Should be true." );
static_assert( HasAlias_value_type< array5d< array1d< R1Tensor > > >, "Should be true." );
static_assert( HasAlias_value_type< stdVector< int > >, "Should be true." );
static_assert( HasAlias_value_type< std::map< string, string > >, "Should be true." );
static_assert( HasAlias_value_type< stdMap< string, string > >, "Should be true." );

static_assert( !HasAlias_value_type< int >, "Should be false." );
static_assert( !HasAlias_value_type< double >, "Should be false." );
Expand Down Expand Up @@ -108,7 +108,7 @@ TEST( testGeosxTraits, HasMemberFunction_data )
static_assert( HasMemberFunction_data< array5d< array1d< R1Tensor > > >, "Should be true." );
static_assert( HasMemberFunction_data< stdVector< int > >, "Should be true." );

static_assert( !HasMemberFunction_data< std::map< string, string > >, "Should be false." );
static_assert( !HasMemberFunction_data< stdMap< string, string > >, "Should be false." );
static_assert( !HasMemberFunction_data< int >, "Should be false." );
static_assert( !HasMemberFunction_data< double >, "Should be false." );
}
Expand All @@ -118,7 +118,7 @@ TEST( testGeosxTraits, HasMemberFunction_size )
static_assert( HasMemberFunction_size< array1d< double > >, "Should be true." );
static_assert( HasMemberFunction_size< array5d< array1d< R1Tensor > > >, "Should be true." );
static_assert( HasMemberFunction_size< stdVector< int > >, "Should be true." );
static_assert( HasMemberFunction_size< std::map< string, string > >, "Should be true." );
static_assert( HasMemberFunction_size< stdMap< string, string > >, "Should be true." );

static_assert( !HasMemberFunction_size< int >, "Should be false." );
static_assert( !HasMemberFunction_size< double >, "Should be false." );
Expand All @@ -132,7 +132,7 @@ TEST( testGeosxTraits, HasMemberFunction_resize )
static_assert( HasMemberFunction_resize< ArrayOfArrays< int > >, "Should be true." );
static_assert( HasMemberFunction_resize< ArrayOfSets< int > >, "Should be true." );

static_assert( !HasMemberFunction_resize< std::map< string, string > >, "Should be false." );
static_assert( !HasMemberFunction_resize< stdMap< string, string > >, "Should be false." );
static_assert( !HasMemberFunction_resize< int >, "Should be false." );
static_assert( !HasMemberFunction_resize< double >, "Should be false." );

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ using namespace geos;

TEST( Utilities, MapExtraction )
{
std::map< string, int > const m{
stdMap< string, int > const m{
{ "k0", 0 },
{ "k1", 1 },
{ "k2", 2 }
Expand Down
12 changes: 6 additions & 6 deletions src/coreComponents/common/MpiWrapper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -318,9 +318,9 @@ struct MpiWrapper
///@}

#if !defined(GEOS_USE_MPI)
static std::map< int, std::pair< int, void * > > & getTagToPointersMap()
static stdMap< int, std::pair< int, void * > > & getTagToPointersMap()
{
static std::map< int, std::pair< int, void * > > tagToPointers;
static stdMap< int, std::pair< int, void * > > tagToPointers;
return tagToPointers;
}
#endif
Expand Down Expand Up @@ -1330,8 +1330,8 @@ int MpiWrapper::iRecv( T * const buf,
"Attempting to use an MPI_Request that is still in use." );
return MPI_Irecv( buf, count, internal::getMpiType< T >(), source, tag, comm, request );
#else
std::map< int, std::pair< int, void * > > & pointerMap = getTagToPointersMap();
std::map< int, std::pair< int, void * > >::iterator iPointer = pointerMap.find( tag );
stdMap< int, std::pair< int, void * > > & pointerMap = getTagToPointersMap();
stdMap< int, std::pair< int, void * > >::iterator iPointer = pointerMap.find( tag );

if( iPointer==pointerMap.end() )
{
Expand Down Expand Up @@ -1427,8 +1427,8 @@ int MpiWrapper::iSend( T const * const buf,
"Attempting to use an MPI_Request that is still in use." );
return MPI_Isend( buf, count, internal::getMpiType< T >(), dest, tag, comm, request );
#else
std::map< int, std::pair< int, void * > > & pointerMap = getTagToPointersMap();
std::map< int, std::pair< int, void * > >::iterator iPointer = pointerMap.find( tag );
stdMap< int, std::pair< int, void * > > & pointerMap = getTagToPointersMap();
stdMap< int, std::pair< int, void * > >::iterator iPointer = pointerMap.find( tag );

if( iPointer==pointerMap.end() )
{
Expand Down
10 changes: 5 additions & 5 deletions src/coreComponents/common/StdContainerWrappers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ namespace internal
/**
* Wrapper for the underlying map that allows toggling between bounds-checked access
* (using at()) and unchecked access (using operator[]).
* @tparam MapType The type of the underlying map (e.g., std::map).
* @tparam MapType The type of the underlying map (e.g., stdMap).
* @tparam Allocator Allocator type for the vector.
* @tparam USE_STD_CONTAINER_BOUNDS_CHECKING A boolean flag to enable or disable bounds checking.
*/
Expand All @@ -154,7 +154,7 @@ template< typename MapType,
class StdMapWrapper : public MapType
{
public:
/// Type alias for the base class (i.e., std::map)
/// Type alias for the base class (i.e., stdMap)
using Base = MapType;
using KeyType = typename Base::key_type;
using MappedType = typename Base::mapped_type;
Expand Down Expand Up @@ -205,9 +205,9 @@ class StdMapWrapper : public MapType
} //namespace internal

/**
* type alias for std::map
* @tparam Key The unique std::map key.
* @tparam T Type of elements in the std::map.
* type alias for stdMap
* @tparam Key The unique stdMap key.
* @tparam T Type of elements in the stdMap.
* @tparam Compare The comparison function used to order the keys. Defaults to std::less<Key>.
* @tparam Allocator Allocator type for the map. Defaults to std::allocator<std::pair<const Key, T>>
*/
Expand Down
7 changes: 4 additions & 3 deletions src/coreComponents/common/format/table/TableData.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,9 @@ class TableData2D
/**
* @brief Add a cell to the table. If necessary, create automatically the containing column & row.
* @tparam T The value passed to addCell (can be any type).
* @param value CellData value to be added.
* @param rowValue The value of the row containing the cell.
* @param columnValue The value of the column containing the cell.
* @param value CellData value to be added.
*/
template< typename T >
void addCell( RowType rowValue, ColumnType columnValue, T const & value );
Expand Down Expand Up @@ -254,7 +254,8 @@ class TableData2D

private:
/// @brief all cell values by their [ row ][ column ]
std::map< RowType, std::map< ColumnType, string > > m_data;
stdMap< RowType, stdMap< ColumnType, string > > m_data;

/// @brief Store all column values when adding cell
std::set< real64 > m_columnValues;
/// @brief Store all errors that can be found during the generation of the TableData
Expand Down Expand Up @@ -297,7 +298,7 @@ void TableData2D::addCell( real64 const rowValue, real64 const columnValue, T co
{
static_assert( has_formatter_v< decltype(value) >, "Argument passed in addCell cannot be converted to string" );
m_columnValues.insert( columnValue );
m_data[rowValue][columnValue] = GEOS_FMT( "{}", value );
m_data.try_emplace( rowValue ).first->second.try_emplace( columnValue, GEOS_FMT( "{}", value ) );
}

}
Expand Down
4 changes: 3 additions & 1 deletion src/coreComponents/common/format/table/TableFormatter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -358,11 +358,12 @@ void TableTextFormatter::populateHeaderCellsLayout( PreparedTableLayout const &
}

// number of times we will divide the each headers in the headerCellsLayout (key is the Column ptr)
std::map< std::ptrdiff_t, size_t > subdivsCount;
stdMap< std::ptrdiff_t, size_t > subdivsCount;

for( auto it = tableLayout.beginDeepFirst(); it != tableLayout.endDeepFirst(); ++it )
{
CellLayout const & currentCell = it->m_header.m_layout;
subdivsCount.try_emplace( std::ptrdiff_t( it.getPtr() ), 0 );
if( currentCell.m_cellType != CellType::Hidden )
{
size_t const layer = it.getCurrentLayer();
Expand All @@ -371,6 +372,7 @@ void TableTextFormatter::populateHeaderCellsLayout( PreparedTableLayout const &
// we subdivide divide parent cells each time we have a cell which has a neightboor to its right
if( it->hasParent() )
{
subdivsCount.try_emplace( std::ptrdiff_t( it->getParent() ), 0 );
// we subdivide the parent by the subdiv count of the current (+1 if cell has a neightboor at its right)
size_t const incrementsCount = subdivsCount[std::ptrdiff_t( it.getPtr() )] + ( it->hasNext() ? 1 : 0 );
subdivsCount[std::ptrdiff_t( it->getParent() )] += incrementsCount;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,11 @@ TEST( testTable, tableEmptyRow )
"CoordZ",
"Prev\nelement",
"Next\nelement"} );

TableData tableData;
tableData.addRow( "value1", "[30.21543]", "3.0", 54, 0 );
tableData.addRow( "", " ", "", "", "" );
tableData.addRow( "Duis fringilla, ligula sed porta fringilla, ligula wisi commodo felis,ut adipiscing felis dui in enim.", "[30.21543]", "30.45465142",
787442, 10 );

TableTextFormatter const tableText( tableLayout );
EXPECT_EQ( tableText.toString( tableData ),
"\n"
Expand Down
4 changes: 2 additions & 2 deletions src/coreComponents/dataRepository/LogLevelsRegistry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
*/

#include "LogLevelsRegistry.hpp"
#include <unordered_set>
#include "common/logger/Logger.hpp"

namespace geos
{

void LogLevelsRegistry::addEntry( integer condition, std::string_view description )
{

auto & targetValues = m_logLevelsDescriptions[condition];
auto & targetValues = m_logLevelsDescriptions.try_emplace( condition ).first->second;

if( !(std::find( targetValues.begin(), targetValues.end(), description ) != targetValues.end()))
{
Expand Down
2 changes: 1 addition & 1 deletion src/coreComponents/dataRepository/LogLevelsRegistry.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class LogLevelsRegistry
* @brief Map for building the log level string for each wrapper.
* key : a logLevel condition, values : a set of description for a corresponding loglevel.
*/
std::map< integer, stdVector< std::string > > m_logLevelsDescriptions;
stdMap< integer, stdVector< std::string > > m_logLevelsDescriptions;

};

Expand Down
2 changes: 1 addition & 1 deletion src/coreComponents/dataRepository/MappedVector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class MappedVector
using mapped_type = T_PTR;

/// the type of the lookup map
using LookupMapType = std::unordered_map< KEY_TYPE, INDEX_TYPE >;
using LookupMapType = stdUnorderedMap< KEY_TYPE, INDEX_TYPE >;

/// the type of the values held in the vector
using value_type = typename std::pair< KEY_TYPE, T_PTR >;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,55 @@ void FieldSpecificationManager::expandObjectCatalogs()

void FieldSpecificationManager::validateBoundaryConditions( MeshLevel & mesh ) const
{
string invalidRegion = "";
stdMap< std::string, std::vector< string > > allPresentFieldsName;
std::set< string > allPresentSets;

mesh.getElemManager().forElementSubRegions< CellElementSubRegion >( [&]( CellElementSubRegion const & subRegion )
{
std::vector< string > subRegionFields;
ObjectManagerBase const * targetOMB = dynamic_cast< ObjectManagerBase const * >( &subRegion );
if( targetOMB )
{ // filter anything that is not an ObjectManagerBase type
// show to the user all fields which are registered under the field-specification object path
subRegionFields.insert( subRegionFields.end(),
targetOMB->getRegisteredFields().begin(),
targetOMB->getRegisteredFields().end() );
}

subRegion.forSubGroups< Group >( [&]( Group const & constitutiveModel )
{
if( constitutiveModel.getName() == ConstitutiveManager::groupKeyStruct::constitutiveModelsString())
{
constitutiveModel.forSubGroups< Group >( [&]( Group const & constitutive )
{
ConstitutiveBase const * constitutiveBase = dynamic_cast< ConstitutiveBase const * >(&constitutive);
auto const constitutiveFields = constitutiveBase->getUserFields();
constitutive.forWrappers(
[&] ( dataRepository::WrapperBase const & wrapper )
{
if( std::find( constitutiveFields.begin(), constitutiveFields.end(),
wrapper.getName()) != constitutiveFields.end())
subRegionFields.insert( subRegionFields.end(),
ConstitutiveBase::makeFieldName( constitutive.getName(),
wrapper.getName()));

} );
} );
}
} );

subRegion.sets().forWrappers( [&] ( dataRepository::WrapperBase const & wrapper )
{
allPresentSets.insert( wrapper.getName());
} );

if( !subRegionFields.empty())
{
allPresentFieldsName.insert( {subRegion.getName(), subRegionFields} );
}
} );

// loop over all the FieldSpecification of the XML file
this->forSubGroups< FieldSpecificationBase >( [&] ( FieldSpecificationBase const & fs )
{
Expand Down
2 changes: 1 addition & 1 deletion src/coreComponents/fileIO/silo/SiloFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1223,7 +1223,7 @@ void SiloFile::writeElementRegionSilo( ElementRegionBase const & elemRegion,
Group fakeGroup( elemRegion.getName(), conduitNode );

localIndex numElems = 0;
stdVector< std::map< string, WrapperBase const * > > viewPointers;
stdVector< stdMap< string, WrapperBase const * > > viewPointers;

viewPointers.resize( elemRegion.numSubRegions() );
elemRegion.forElementSubRegionsIndex< ElementSubRegionBase >(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1319,7 +1319,7 @@ void VTKPolyDataWriterInterface::writeUnstructuredGrid( string const & path,
globalValues.end(),
[]( int x ) { return x == -1; } ),
globalValues.end());
m_targetProcessesId[region.getName()] = globalValues;
m_targetProcessesId.insert( {region.getName(), globalValues} );
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ class VTKPolyDataWriterInterface
integer m_numberOfTargetProcesses;

/// Map a region name to the array of ranks outputed for it
std::map< string, stdVector< integer > > m_targetProcessesId;
stdMap< string, stdVector< integer > > m_targetProcessesId;
};

} // namespace vtk
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -895,12 +895,12 @@ void TwoPointFluxApproximation::computeAquiferStencil( DomainPartition & domain,

// Step 1: count individual aquifers

std::map< string, localIndex > aquiferNameToAquiferId;
stdMap< string, localIndex > aquiferNameToAquiferId;
localIndex aquiferCounter = 0;

fsManager.forSubGroups< AquiferBoundaryCondition >( [&] ( AquiferBoundaryCondition const & bc )
{
aquiferNameToAquiferId[bc.getName()] = aquiferCounter;
aquiferNameToAquiferId.insert( {bc.getName(), aquiferCounter} );
aquiferCounter++;
} );

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ enum class Axis : integer { X = 0, Y = 1, Z = 2 };
* @brief a map of the half transmissibilities, from the first to the second cell identified by the
* key global id.
*/
using TransmissibilityMap = std::map< std::pair< globalIndex, globalIndex >, real64 >;
using TransmissibilityMap = stdMap< std::pair< globalIndex, globalIndex >, real64 >;

/**
* @brief the parameters for a given test instance.
Expand Down Expand Up @@ -288,7 +288,7 @@ TransmissibilityMap getTransmissibilityMap( StencilDataCollection const & stenci
TransmissibilityMap transmissibilities;
for( int i = 0; i < arraySize; ++i )
{
transmissibilities[std::make_pair( cellAGlobalId[i], cellBGlobalId[i] )] = transmissibilityAB[i];
transmissibilities.insert( {std::make_pair( cellAGlobalId[i], cellBGlobalId[i] ), transmissibilityAB[i]} );
}
return transmissibilities;
}
Expand Down
Loading
Loading