Skip to content
Open
Show file tree
Hide file tree
Changes from 7 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
4 changes: 2 additions & 2 deletions src/coreComponents/codingUtilities/tests/testParsing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class ParsingTest : public ::testing::TestWithParam< T >
{
protected:

static constexpr std::array< char, 4 > const separators = { ' ', ',', '\n', ';' };
static constexpr geos::stdArray< char, 4 > const separators = { ' ', ',', '\n', ';' };

static bool issep( char const c )
{
Expand Down Expand Up @@ -147,7 +147,7 @@ class ParsingTest : public ::testing::TestWithParam< T >
};

template< typename T >
std::array< char, 4 > const ParsingTest< T >::separators;
geos::stdArray< char, 4 > const ParsingTest< T >::separators;

using Types = ::testing::Types<
float,
Expand Down
4 changes: 2 additions & 2 deletions src/coreComponents/common/MpiWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -445,9 +445,9 @@ int MpiWrapper::nodeCommSize()
return 1;

int len;
std::array< char, MPI_MAX_PROCESSOR_NAME + 1 > hostname;
stdArray< char, MPI_MAX_PROCESSOR_NAME + 1 > hostname;
MPI_Get_processor_name( hostname.data(), &len );
hostname[len] = '\0';
hostname.at(len) = '\0';
int color = (int)std::hash< string >{} (hostname.data());
if( color < 0 )
color *= -1;
Expand Down
2 changes: 2 additions & 0 deletions src/coreComponents/common/StdContainerWrappers.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#ifndef GEOS_COMMON_STD_CONTAINER_WRAPPERS_HPP
#define GEOS_COMMON_STD_CONTAINER_WRAPPERS_HPP

#include <array>
#include <cstddef>
#include <array>
#include <cstddef>
#include <vector>
Expand Down
6 changes: 3 additions & 3 deletions src/coreComponents/constitutive/unitTests/TestFluid.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ struct Fluid

static constexpr integer NP = 6; // Number of properties

static constexpr std::array<real64,84> data = {
static constexpr stdArray<real64,84> data = {
// Mw Pc Tc Vc Ac Pr Name
1.80153e-02, 2.20640e+07, 6.47096e+02, 5.59480e-05, 3.44300e-01, 9.36563e-06, // H2O (water)
4.40095e-02, 7.37730e+06, 3.04128e+02, 9.41185e-05, 2.23940e-01, 7.37268e-06, // CO2 (carbon dioxide)
Expand All @@ -83,15 +83,15 @@ struct Fluid
};

template< int NC >
using Feed = std::array< real64, NC >;
using Feed = stdArray< real64, NC >;

template< int NC >
class TestFluid
{
public:
~TestFluid() = default;

static std::unique_ptr< TestFluid< NC > > create( std::array< integer, NC > const & components )
static std::unique_ptr< TestFluid< NC > > create( stdArray< integer, NC > const & components )
{
std::unique_ptr< TestFluid< NC > > testFluid( new TestFluid() );
for( integer const ic : components )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ struct FluidData< 9 >
static std::unique_ptr< TestFluid< 9 > > createFluid()
{
auto fluid = TestFluid< 9 >::create( {Fluid::H2O, Fluid::CO2, Fluid::N2, Fluid::CH4, Fluid::C2H6, Fluid::C3H8, Fluid::C4H10, Fluid::C5H12, Fluid::C10H22} );
const std::array< real64 const, 36 > bics = {
const stdArray< real64 const, 36 > bics = {
0.01, 0, 0.003732, 0, 0.01, 0, 0, 0.01, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0.01, 0, 0.028, 0.01, 0.01, 0, 0, 0.01, 0, 0.04532, 0.01, 0.01, 0, 0, 0
};
Expand Down
4 changes: 2 additions & 2 deletions src/coreComponents/constitutive/unitTests/testCubicEOS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ struct FluidData< 2 >
return fluid;
}

static std::array< Feed< 2 >, 3 > constexpr feeds = {
static stdArray< Feed< 2 >, 3 > constexpr feeds = {
Feed< 2 >{0.995, 0.005},
Feed< 2 >{0.990, 0.010},
Feed< 2 >{0.100, 0.900}
Expand All @@ -57,7 +57,7 @@ struct FluidData< 4 >
return fluid;
}

static std::array< Feed< 4 >, 4 > constexpr feeds = {
static stdArray< Feed< 4 >, 4 > constexpr feeds = {
Feed< 4 >{0.030933, 0.319683, 0.637861, 0.011523},
Feed< 4 >{0.000000, 0.349686, 0.637891, 0.012423},
Feed< 4 >{0.000000, 0.349686, 0.650314, 0.000000},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ struct FluidData< 3 >
static std::unique_ptr< TestFluid< 3 > > createFluid()
{
auto fluid = TestFluid< 3 >::create( {Fluid::CH4, Fluid::C10H22, Fluid::H2O} );
const std::array< real64 const, 3 > bics = { 0.25, 0.0, 0.0 };
const stdArray< real64 const, 3 > bics = { 0.25, 0.0, 0.0 };
fluid->setBinaryCoefficients( bics );
return fluid;
}
Expand All @@ -69,9 +69,9 @@ struct FluidData< 9 >
static std::unique_ptr< TestFluid< 9 > > createFluid()
{
auto fluid = TestFluid< 9 >::create( {Fluid::H2O, Fluid::CO2, Fluid::N2, Fluid::C5H12, Fluid::C2H6, Fluid::C3H8, Fluid::C4H10, Fluid::C5H12, Fluid::C10H22} );
const std::array< real64 const, 36 > bics = {
const stdArray< real64, 36 > bics = {
0.01, 0, 0.003732, 0, 0.01, 0, 0, 0.01, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0.01, 0, 0.028, 0.01, 0.01, 0, 0, 0.01, 0, 0.04532, 0.01, 0.01, 0, 0, 0
0, 0, 0, 0.01, 0, 0.028, 0.01, 0.01, 0, 0, 0.01, 0, 0.04532, 0.01, 0.01, 0, 0, 0
};
fluid->setBinaryCoefficients( bics );
return fluid;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ struct FluidData< 3 >
static std::unique_ptr< TestFluid< 3 > > createFluid()
{
auto fluid = TestFluid< 3 >::create( {Fluid::CH4, Fluid::C10H22, Fluid::H2O} );
std::array< real64, 3 > const bics = {0.25, 0.0, 0.0};
stdArray< real64, 3 > const bics = {0.25, 0.0, 0.0};
fluid->setBinaryCoefficients( bics );
return fluid;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ struct TestData< 9 >
static std::unique_ptr< TestFluid< 9 > > createFluid()
{
auto fluid = TestFluid< 9 >::create( {Fluid::H2O, Fluid::CO2, Fluid::N2, Fluid::CH4, Fluid::C2H6, Fluid::C3H8, Fluid::C4H10, Fluid::C5H12, Fluid::C10H22} );
const std::array< real64 const, 36 > bics = {
const stdArray< real64 const, 36 > bics = {
0.01, 0, 0.003732, 0, 0.01, 0, 0, 0.01, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0.01, 0, 0.028, 0.01, 0.01, 0, 0, 0.01, 0, 0.04532, 0.01, 0.01, 0, 0, 0
};
Expand Down Expand Up @@ -113,7 +113,7 @@ class KValueFlashTestFixture< numPhases, numComps >::MockFluid : public MultiFlu
void setProperties( ComponentProperties const & componentProperties )
{
string_array & phaseNames = getReference< string_array >( MultiFluidBase::viewKeyStruct::phaseNamesString() );
TestFluid< numPhases >::createArray( phaseNames, std::array< string, 2 >{"oil", "gas"} );
TestFluid< numPhases >::createArray( phaseNames, stdArray< string, 2 >{"oil", "gas"} );
string_array & componentNames = getReference< string_array >( MultiFluidBase::viewKeyStruct::componentNamesString() );
TestFluid< numPhases >::createArray( componentNames, componentProperties.getComponentName());
}
Expand Down Expand Up @@ -163,7 +163,7 @@ real64 getKValue( integer const phaseIndex, integer const compIndex, real64 cons
{
GEOS_UNUSED_VAR( phaseIndex );

static std::array< real64, 5 > constexpr crookstonCoefficients[9] = {
static stdArray< real64, 5 > constexpr crookstonCoefficients[9] = {
{3.0620e+00, 8.9414e+02, 1.1912e-02, 5.3659e+02, 1.1951e+02},
{-1.8141e+00, 6.2655e+02, 6.7489e-03, 5.0732e+00, 2.5249e+02},
{-3.5742e-01, 4.8660e+02, 5.7887e-03, 9.1910e+01, 1.8027e+02},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ struct FluidData< 9 >
static std::unique_ptr< TestFluid< 9 > > createFluid()
{
auto fluid = TestFluid< 9 >::create( {Fluid::H2O, Fluid::CO2, Fluid::N2, Fluid::CH4, Fluid::C2H6, Fluid::C3H8, Fluid::C4H10, Fluid::C5H12, Fluid::C10H22} );
const std::array< real64 const, 36 > bics = {
const stdArray< real64 const, 36 > bics = {
0.01, 0, 0.003732, 0, 0.01, 0, 0, 0.01, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0.01, 0, 0.028, 0.01, 0.01, 0, 0, 0.01, 0, 0.04532, 0.01, 0.01, 0, 0, 0
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ string MultiFluidCompositionalMultiphaseTestFixture< TEST_TYPE >::getFluidName()
}

template< integer NUM_COMP >
static void fillBinaryCoeffs( array2d< real64 > & binaryCoeff, std::array< real64 const, NUM_COMP *(NUM_COMP-1)/2 > const data )
static void fillBinaryCoeffs( array2d< real64 > & binaryCoeff, stdArray< real64 const, NUM_COMP *(NUM_COMP-1)/2 > const data )
{
auto bic = data.begin();
binaryCoeff.resize( NUM_COMP, NUM_COMP );
Expand All @@ -117,7 +117,7 @@ static void fillBinaryCoeffs( array2d< real64 > & binaryCoeff, std::array< real6
}

template< integer NUM_COMP >
static void populateArray( arraySlice1d< real64 > array, std::array< real64 const, NUM_COMP > const data )
static void populateArray( arraySlice1d< real64 > array, stdArray< real64 const, NUM_COMP > const data )
{
for( integer i = 0; i < NUM_COMP; ++i )
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ string MultiFluidCompositionalMultiphaseTestFixture< TEST_TYPE >::getFluidName()
}

template< integer NUM_COMP >
static void fillBinaryCoeffs( array2d< real64 > & binaryCoeff, std::array< real64 const, NUM_COMP *(NUM_COMP-1)/2 > const data )
static void fillBinaryCoeffs( array2d< real64 > & binaryCoeff, stdArray< real64 const, NUM_COMP *(NUM_COMP-1)/2 > const data )
{
auto bic = data.begin();
binaryCoeff.resize( NUM_COMP, NUM_COMP );
Expand All @@ -138,7 +138,7 @@ static void fillBinaryCoeffs( array2d< real64 > & binaryCoeff, std::array< real6
}

template< integer NUM_COMP >
static void populateArray( arraySlice1d< real64 > array, std::array< real64 const, NUM_COMP > const data )
static void populateArray( arraySlice1d< real64 > array, stdArray< real64 const, NUM_COMP > const data )
{
for( integer i = 0; i < NUM_COMP; ++i )
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ struct FluidData< 2 >
static std::unique_ptr< TestFluid< 2 > > createFluid()
{
auto fluid = TestFluid< 2 >::create( {Fluid::CH4, Fluid::C5H12} );
const std::array< real64 const, 2 > bics = { 0.5 };
const stdArray< real64 const, 2 > bics = { 0.5 };
fluid->setBinaryCoefficients( bics );
return fluid;
}
Expand All @@ -68,7 +68,7 @@ struct FluidData< 4 >
static std::unique_ptr< TestFluid< 4 > > createFluid()
{
auto fluid = TestFluid< 4 >::create( {Fluid::CH4, Fluid::CO2, Fluid::H2S, Fluid::H2O} );
const std::array< real64 const, 6 > bics = { 0.0, 0.0, 0.0, 0.4850, 0.1896, 0.1353 };
const stdArray< real64 const, 6 > bics = { 0.0, 0.0, 0.0, 0.4850, 0.1896, 0.1353 };
fluid->setBinaryCoefficients( bics );
return fluid;
}
Expand All @@ -81,7 +81,7 @@ struct FluidData< 9 >
static std::unique_ptr< TestFluid< 9 > > createFluid()
{
auto fluid = TestFluid< 9 >::create( {Fluid::H2O, Fluid::CO2, Fluid::N2, Fluid::CH4, Fluid::C2H6, Fluid::C3H8, Fluid::C4H10, Fluid::C5H12, Fluid::C8H18} );
const std::array< real64 const, 36 > bics = {
const stdArray< real64 const, 36 > bics = {
0.01, 0, 0.003732, 0, 0.01, 0, 0, 0.01, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0.01, 0, 0.028, 0.01, 0.01, 0, 0, 0.01, 0, 0.04532, 0.01, 0.01, 0, 0, 0
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ struct FluidData< 2 >
return TestFluid< 2 >::create( {Fluid::H2O, Fluid::C10H22} );
}

static std::array< Feed< 2 >, 3 > constexpr feeds = {
static stdArray< Feed< 2 >, 3 > constexpr feeds = {
Feed< 2 >{0.995, 0.005},
Feed< 2 >{1.000, 0.000},
Feed< 2 >{0.002, 0.998}
Expand All @@ -53,7 +53,7 @@ struct FluidData< 3 >
return TestFluid< 3 >::create( {Fluid::H2O, Fluid::H2S, Fluid::H2} );
}

static std::array< Feed< 3 >, 3 > constexpr feeds = {
static stdArray< Feed< 3 >, 3 > constexpr feeds = {
Feed< 3 >{0.995, 0.000, 0.005},
Feed< 3 >{0.990, 0.005, 0.005},
Feed< 3 >{0.970, 0.025, 0.005}
Expand All @@ -70,7 +70,7 @@ struct FluidData< 4 >
return fluid;
}

static std::array< Feed< 4 >, 4 > constexpr feeds = {
static stdArray< Feed< 4 >, 4 > constexpr feeds = {
Feed< 4 >{0.030933, 0.319683, 0.637861, 0.011523},
Feed< 4 >{0.000000, 0.349686, 0.637891, 0.012423},
Feed< 4 >{0.000000, 0.349686, 0.650314, 0.000000},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ TEST_P( SoreideWhitsonSolubilityTestFixture, testSolubility )
/* UNCRUSTIFY-OFF */
// Soreide-Whitson correlations work only with "true" values of component parameters
// kij_NA is the binary interation coefficient in the gas phase (see Table 5 Soreide-Whitson (1992))
std::unordered_map<integer, std::array<real64 const, 6> const> const componentDatabase = {
std::unordered_map<integer, stdArray<real64 const, 6> const> const componentDatabase = {
// Mw Pc Tc Vc Ac kij_NA
{Fluid::H2O, { 1.80153e-02, 2.20640e+07, 6.47096e+02, 5.59480e-05, 3.44300e-01, 0.0000 }},
{Fluid::CO2, { 4.40095e-02, 7.37730e+06, 3.04128e+02, 9.41185e-05, 2.23940e-01, 0.1896 }},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ TEST( wrapperHelpers, size )
checkSizeMethod( string( "hello" ) );
checkSizeMethod( std::set< int > { 1, 2, 3 } );
checkSizeMethod( stdVector< int > { 1, 2, 3 } );
checkSizeMethod( std::array< int, 5 > {} );
checkSizeMethod( stdArray< int, 5 > {} );
checkSizeMethod( array1d< int >( 5 ) );
checkSizeMethod( array2d< int >( 5, 5 ) );
}
Expand Down
4 changes: 2 additions & 2 deletions src/coreComponents/dataRepository/wrapperHelpers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ pushDataToConduitNode( Array< T, NDIM, PERMUTATION > const & var,
node[ "__dimensions__" ].set( dimensionType, temp );

// Create a copy of the permutation
constexpr std::array< camp::idx_t, NDIM > const perm = to_stdArray( RAJA::as_array< PERMUTATION >::get());
constexpr stdArray< camp::idx_t, NDIM > const perm = to_stdArray( RAJA::as_array< PERMUTATION >::get());
for( int i = 0; i < NDIM; ++i )
{
temp[ i ] = perm[ i ];
Expand Down Expand Up @@ -454,7 +454,7 @@ pullDataFromConduitNode( Array< T, NDIM, PERMUTATION > & var,
conduit::Node const & permutationNode = node.fetch_existing( "__permutation__" );
GEOS_ERROR_IF_NE( permutationNode.dtype().number_of_elements(), totalNumDimensions );

constexpr std::array< camp::idx_t, NDIM > const perm = to_stdArray( RAJA::as_array< PERMUTATION >::get());
constexpr stdArray< camp::idx_t, NDIM > const perm = to_stdArray( RAJA::as_array< PERMUTATION >::get());
camp::idx_t const * const permFromConduit = permutationNode.value();
for( int i = 0; i < NDIM; ++i )
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,9 @@ static string_view constexpr stencilDataCollectionPath = "/Tasks/cellToCellDataC


/// a "stack" array to represent 3d floating point data (ie. coords)
using Float3 = std::array< real64, 3 >;
using Float3 = stdArray< real64, 3 >;
/// a "stack" array to represent 3d integer data (ie. cell count / axis)
using Int3 = std::array< integer, 3 >;
using Int3 = stdArray< integer, 3 >;

/// Enumeration of the 3D axis to take into account for a structured mesh.
enum class Axis : integer { X = 0, Y = 1, Z = 2 };
Expand Down Expand Up @@ -196,7 +196,7 @@ TEST( TransmissibilityTest, StencilOutputVerificationAniso )
std::ostringstream xmlInput;
xmlInput << xmlInputCommon << meshInput << xmlInputEnd;

static TestParams constexpr params {
static TestParams constexpr params {
{ 3, 4, 5 }, // cellCount
{ 70.0, 10.0, 54.321 }, // meshSize
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ struct forLocalObjectsImpl< FieldLocation::Elem >
{
if( ghostRank[ei] < 0 )
{
lambda( std::array< localIndex, 3 > { er, esr, ei} );
lambda( stdArray< localIndex, 3 > { er, esr, ei} );
}
}
} );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -397,13 +397,13 @@ TEST( VTKImport, cube )

// FIXME How to get the CellBlock as a function of the region, without knowing the naming pattern.
// 1 elements type on 3 regions ("-1", "3", "9") = 3 sub-groups
std::array< std::pair< string, int >, 3 > const expectedCellBlocks =
stdArray const expectedCellBlocks =
{
{
{ "hexahedra", expectedSwap( 1, { 1, 0 } ) },
{ "3_hexahedra", expectedSwap( 25, { 16, 9 } ) },
{ "9_hexahedra", expectedSwap( 1, { 1, 0 } ) }
}

std::make_pair( "hexahedra", expectedSwap( 1, { 1, 0 } ) ),
std::make_pair( "3_hexahedra", expectedSwap( 25, { 16, 9 } ) ),
std::make_pair( "9_hexahedra", expectedSwap( 1, { 1, 0 } ) )

};
ASSERT_EQ( cellBlockManager.getCellBlocks().numSubGroups(), expectedCellBlocks.size() );

Expand Down
2 changes: 1 addition & 1 deletion src/coreComponents/linearAlgebra/DofManagerHelpers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ template<>
struct MeshHelper< FieldLocation::Elem >
{
using ManagerType = ElementSubRegionBase;
using LocalIndexType = std::array< localIndex, 3 >;
using LocalIndexType = stdArray< localIndex, 3 >;

static LocalIndexType constexpr invalid_local_index{ -1, -1, -1 };

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,25 +181,25 @@ class BlockPreconditioner : public PreconditionerBase< LAI >
LinearSolverParameters::Block m_params;

/// Description of dof components making up each of the two main blocks
std::array< stdVector< DofManager::SubComponent >, 2 > m_blockDofs{};
stdArray< stdVector< DofManager::SubComponent >, 2 > m_blockDofs{};

/// Pointers to prolongation operators for each sub-block
std::array< Matrix const *, 2 > m_prolongators{};
stdArray< Matrix const *, 2 > m_prolongators{};

/// Prolongation operators for each sub-block
std::array< Matrix, 2 > m_prolongatorsOwned{};
stdArray< Matrix, 2 > m_prolongatorsOwned{};

/// Matrix blocks
BlockOperator< Vector, Matrix > m_matBlocks;

/// Individual block preconditioner pointers
std::array< PreconditionerBase< LAI > *, 2 > m_solvers{};
stdArray< PreconditionerBase< LAI > *, 2 > m_solvers{};

/// Individual block preconditioner operators (when owned)
std::array< std::unique_ptr< PreconditionerBase< LAI > >, 2 > m_solversOwned{};
stdArray< std::unique_ptr< PreconditionerBase< LAI > >, 2 > m_solversOwned{};

/// Scaling of each block
std::array< real64, 2 > m_scaling{};
stdArray< real64, 2 > m_scaling{};

/// Internal vector of block residuals
mutable BlockVector< Vector > m_rhs;
Expand Down
2 changes: 1 addition & 1 deletion src/coreComponents/mesh/BufferOps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ localIndex Unpack( buffer_unit_type const * & buffer,
sizeOfUnpackedChars += bufferOps::Unpack( buffer, numIndicesUnpacked );
GEOS_ERROR_IF( numIndicesUnpacked != packList.size(), "" );

using ElementID = std::array< localIndex, 3 >;
using ElementID = stdArray< localIndex, 3 >;

// Allocate some memory to store map entries that don't fit in existing capacity
array1d< localIndex > indicesToReplace;
Expand Down
Loading
Loading