mirror of
https://github.com/OPM/opm-upscaling.git
synced 2026-08-26 13:07:11 -05:00
replace std::copy with std::copy_n where appropriate
more expressive
This commit is contained in:
@@ -27,7 +27,7 @@ class MortarUtils {
|
||||
static void extractBlock(Vector& x, const Vector& y, int len, int start = 0)
|
||||
{
|
||||
x.resize(len);
|
||||
std::copy(y.begin() + start, y.begin() + len + start, x.begin());
|
||||
std::copy_n(y.begin() + start, len, x.begin());
|
||||
}
|
||||
|
||||
//! \brief Inject a range of indices into a vector
|
||||
@@ -37,7 +37,7 @@ class MortarUtils {
|
||||
//! \param[in] start The first index in the range
|
||||
static void injectBlock(Vector& x, const Vector& y, int len, int start = 0)
|
||||
{
|
||||
std::copy(y.begin(), y.begin() + len, x.begin() + start);
|
||||
std::copy_n(y.begin(), len, x.begin() + start);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -155,7 +155,7 @@ namespace Opm
|
||||
int pos = (dims_[0] + 1)*j + i;
|
||||
int new_pos = (new_dims_[0] + 1)*(j-jmin) + (i-imin);
|
||||
// Copy all 6 coordinates for a pillar.
|
||||
std::copy(COORD.begin() + 6*pos, COORD.begin() + 6*(pos + 1), new_COORD_.begin() + 6*new_pos);
|
||||
std::copy_n(COORD.begin() + 6*pos, 6, new_COORD_.begin() + 6*new_pos);
|
||||
if (resettoorigin) {
|
||||
// Substract lowest x value from all X-coords, similarly for y, and truncate in z-direction
|
||||
new_COORD_[6*new_pos] -= x_correction;
|
||||
|
||||
Reference in New Issue
Block a user