-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Removed Cross products. Fixed BoundedPlane, ThickPlane, ComputationalGeometry. Started removal of Dot from solvers and surfGenerators. * Clean up more R1Tensor uses. Get rid or realT. * A few more cleanups. * Remove most R1Tensor uses in flow solvers * surfaceGen r1Tensor operators * R1Tensor initialization in surfGen * removed R1Tensor use from all remaining solvers. * WIP change R1Tensor in EmbSurfSubregion * Templated functions on array_type in CompGeometry. * Add Simple Tensor type for input * Bugfix local var initialization Co-authored-by: Sergey Klevtsov <[email protected]> Co-authored-by: Randolph R. Settgast <[email protected]>
- Loading branch information
1 parent
ecaa0f2
commit 1e1a3e6
Showing
103 changed files
with
1,853 additions
and
3,679 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,22 @@ | ||
[submodule "src/coreComponents/LvArray"] | ||
path = src/coreComponents/LvArray | ||
url = https://github.com/GEOSX/LvArray.git | ||
url = ../LvArray.git | ||
[submodule "src/cmake/blt"] | ||
path = src/cmake/blt | ||
url = https://github.com/LLNL/blt.git | ||
url = ../../LLNL/blt.git | ||
[submodule "src/externalComponents/PVTPackage"] | ||
path = src/externalComponents/PVTPackage | ||
url = https://github.com/GEOSX/PVTPackage.git | ||
url = ../PVTPackage.git | ||
[submodule "integratedTests"] | ||
path = integratedTests | ||
url = [email protected]:GEOSX/integratedTests.git | ||
url = ../integratedTests.git | ||
[submodule "src/externalComponents/PAMELA"] | ||
path = src/externalComponents/PAMELA | ||
url = https://github.com/GEOSX/PAMELA.git | ||
url = ../PAMELA.git | ||
shallow = true | ||
[submodule "src/coreComponents/fileIO/coupling/hdf5_interface"] | ||
path = src/coreComponents/fileIO/coupling/hdf5_interface | ||
url = https://github.com/GEOSX/hdf5_interface.git | ||
url = ../hdf5_interface.git | ||
[submodule "src/coreComponents/physicsSolvers/GEOSX_PTP"] | ||
path = src/coreComponents/physicsSolvers/GEOSX_PTP | ||
url = https://github.com/GEOSX/GEOSX_PTP.git | ||
url = ../GEOSX_PTP.git |
Submodule LvArray
updated
5 files
+77 −1 | docs/sphinx/developmentAids.rst | |
+28 −17 | scripts/gdb-printers.py | |
+68 −17 | src/genericTensorOps.hpp | |
+18 −0 | src/typeManipulation.hpp | |
+83 −0 | unitTests/testTensorOpsOneSize.cpp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ set(common_headers | |
TimingMacros.hpp | ||
Logger.hpp | ||
DataLayouts.hpp | ||
Tensor.hpp | ||
) | ||
|
||
# | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,148 @@ | ||
/* | ||
* ------------------------------------------------------------------------------------------------------------ | ||
* SPDX-License-Identifier: LGPL-2.1-only | ||
* | ||
* Copyright (c) 2018-2020 Lawrence Livermore National Security LLC | ||
* Copyright (c) 2018-2020 The Board of Trustees of the Leland Stanford Junior University | ||
* Copyright (c) 2018-2020 Total, S.A | ||
* Copyright (c) 2019- GEOSX Contributors | ||
* All rights reserved | ||
* | ||
* See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details. | ||
* ------------------------------------------------------------------------------------------------------------ | ||
*/ | ||
|
||
#ifndef GEOSX_COMMON_TENSOR_HPP_ | ||
#define GEOSX_COMMON_TENSOR_HPP_ | ||
|
||
#include "common/GeosxMacros.hpp" | ||
|
||
namespace geosx | ||
{ | ||
|
||
/** | ||
* @brief Lightweight wrapper around a c-array | ||
* @tparam T data type | ||
* @tparam SIZE_TPARAM number of values | ||
*/ | ||
template< typename T, int SIZE_TPARAM > | ||
class Tensor | ||
{ | ||
public: | ||
|
||
static_assert( SIZE_TPARAM > 0, "Tensor size must be a positive value" ); | ||
|
||
/// Alias for type template parameter | ||
using value_type = T; | ||
|
||
/// Alias for size template parameter | ||
static constexpr int SIZE = SIZE_TPARAM; | ||
|
||
/** | ||
* @brief Const element access. | ||
* @param i element index | ||
* @return const reference to the i-th element | ||
*/ | ||
GEOSX_HOST_DEVICE | ||
GEOSX_FORCE_INLINE | ||
T const & operator[]( std::ptrdiff_t const i ) const | ||
{ | ||
return data[i]; | ||
} | ||
|
||
/** | ||
* @brief Non-const element access. | ||
* @param i element index | ||
* @return reference to the i-th element | ||
*/ | ||
GEOSX_HOST_DEVICE | ||
GEOSX_FORCE_INLINE | ||
T & operator[]( std::ptrdiff_t const i ) | ||
{ | ||
return data[i]; | ||
} | ||
|
||
/** | ||
* @brief Equality comparison operator. | ||
* @tparam U dummy parameter to enable SFINAE, do not provide explicitly | ||
* @param rhs the right-hand side value to compare to | ||
* @return true iff @code data[i] == rhs.data[i] @endcode | ||
* @note Version for floating point types that avoids direct equality comparison. | ||
*/ | ||
template< typename U = T > | ||
GEOSX_HOST_DEVICE | ||
GEOSX_FORCE_INLINE | ||
std::enable_if_t< std::is_floating_point< U >::value, bool > | ||
operator==( Tensor< U, SIZE > const & rhs ) const | ||
{ | ||
for( int i = 0; i < SIZE; ++i ) | ||
{ | ||
if( (data[i] > rhs.data[i]) || (data[i] < rhs.data[i]) ) | ||
{ | ||
return false; | ||
} | ||
} | ||
return true; | ||
} | ||
|
||
/** | ||
* @brief Equality comparison operator. | ||
* @tparam U dummy parameter to enable SFINAE, do not provide explicitly | ||
* @param rhs the right-hand side value to compare to | ||
* @return true iff @code data[i] == rhs.data[i] @endcode | ||
* @note Version for all types except floating point. | ||
*/ | ||
template< typename U = T > | ||
GEOSX_HOST_DEVICE | ||
GEOSX_FORCE_INLINE | ||
std::enable_if_t< !std::is_floating_point< U >::value, bool > | ||
operator==( Tensor< U, SIZE > const & rhs ) const | ||
{ | ||
for( int i = 0; i < SIZE; ++i ) | ||
{ | ||
if( data[i] != rhs.data[i] ) | ||
{ | ||
return false; | ||
} | ||
} | ||
return true; | ||
} | ||
|
||
/** | ||
* @brief Returns the size of the tensor | ||
* @param junk Unused | ||
* @return The value of the template parameter SIZE. | ||
*/ | ||
GEOSX_HOST_DEVICE | ||
GEOSX_FORCE_INLINE | ||
constexpr int size( int junk ) const | ||
{ | ||
GEOSX_UNUSED_VAR( junk ) | ||
return SIZE; | ||
} | ||
|
||
/// Underlying array | ||
T data[SIZE] = {}; | ||
|
||
private: | ||
|
||
/** | ||
* @brief Stream insertion operator for Tensor. | ||
* @param os the output stream | ||
* @param t the tensor value | ||
* @return reference to @p os | ||
*/ | ||
friend inline std::ostream & operator<<( std::ostream & os, Tensor< T, SIZE > const & t ) | ||
{ | ||
os << t.data[0]; | ||
for( int i = 1; i < SIZE; ++i ) | ||
{ | ||
os << ',' << t.data[i]; | ||
} | ||
return os; | ||
} | ||
}; | ||
|
||
} | ||
|
||
#endif //GEOSX_COMMON_TENSOR_HPP_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.