--- /dev/null
+Chaned: VectorizedArray::n_array_elements has been deprecated.
+Please use the method VectorizedArray::size() to access the same information.
+<br>
+(Peter Munch, 2020/03/20)
*
* @author Peter Munch, 2019
*/
-template <typename T>
+template <typename T, std::size_t width>
class VectorizedArrayBase
{
public:
/**
- * Return the number of elements in the array stored in the variable
- * n_array_elements of VectorizedArray.
+ * Return the number of elements in the array.
*/
static constexpr std::size_t
size()
{
- return T::n_array_elements;
+ return width;
}
/**
VectorizedArrayIterator<T>
end()
{
- return VectorizedArrayIterator<T>(static_cast<T &>(*this),
- T::n_array_elements);
+ return VectorizedArrayIterator<T>(static_cast<T &>(*this), width);
}
/**
end() const
{
return VectorizedArrayIterator<const T>(static_cast<const T &>(*this),
- T::n_array_elements);
+ width);
}
};
*/
template <typename Number, std::size_t width>
class VectorizedArray
- : public VectorizedArrayBase<VectorizedArray<Number, width>>
+ : public VectorizedArrayBase<VectorizedArray<Number, width>, 1>
{
public:
/**
* case, there is only one element. Specializations use SIMD intrinsics and
* can work on multiple elements at the same time.
*/
- static const unsigned int n_array_elements = 1;
+ DEAL_II_DEPRECATED static const unsigned int n_array_elements = 1;
- static_assert(width == n_array_elements,
+ static_assert(width == 1,
"You specified an illegal width that is not supported.");
/**
}
/**
- * Load @p n_array_elements from memory into the calling class, starting at
+ * Load size() data items from memory into the calling class, starting at
* the given address. The pointer `ptr` needs not be aligned by the amount
* of bytes in the vectorized array, as opposed to casting a double address
* to VectorizedArray<double>*.
}
/**
- * Write the content of the calling class into memory in form of @p
- * n_array_elements to the given address. The pointer `ptr` needs not be
+ * Write the content of the calling class into memory in form of
+ * size() data items to the given address. The pointer `ptr` needs not be
* aligned by the amount of bytes in the vectorized array, as opposed to
* casting a double address to VectorizedArray<double>*.
*/
/**
* Write the content of the calling class into memory in form of
- * @p n_array_elements to the given address using non-temporal stores that
+ * size() data items to the given address using non-temporal stores that
* bypass the processor's caches, using @p _mm_stream_pd store intrinsics on
* supported CPUs. The destination of the store @p ptr must be aligned by
* the amount of bytes in the vectorized array.
}
/**
- * Load @p n_array_elements from memory into the calling class, starting at
+ * Load size() data items from memory into the calling class, starting at
* the given address and with given offsets, each entry from the offset
* providing one element of the vectorized array.
*
* This operation corresponds to the following code (but uses a more
* efficient implementation in case the hardware allows for that):
* @code
- * for (unsigned int v=0; v<VectorizedArray<Number>::n_array_elements; ++v)
+ * for (unsigned int v=0; v<VectorizedArray<Number>::size(); ++v)
* this->operator[](v) = base_ptr[offsets[v]];
* @endcode
*/
}
/**
- * Write the content of the calling class into memory in form of @p
- * n_array_elements to the given address and the given offsets, filling the
+ * Write the content of the calling class into memory in form of
+ * size() data items to the given address and the given offsets, filling the
* elements of the vectorized array into each offset.
*
* This operation corresponds to the following code (but uses a more
* efficient implementation in case the hardware allows for that):
* @code
- * for (unsigned int v=0; v<VectorizedArray<Number>::n_array_elements; ++v)
+ * for (unsigned int v=0; v<VectorizedArray<Number>::size(); ++v)
* base_ptr[offsets[v]] = this->operator[](v);
* @endcode
*/
static_assert(
std::is_same<VectorizedArrayType,
VectorizedArray<typename VectorizedArrayType::value_type,
- VectorizedArrayType::n_array_elements>>::value,
+ VectorizedArrayType::size()>>::value,
"VectorizedArrayType is not a VectorizedArray.");
VectorizedArrayType result = u;
/**
- * Load @p n_array_elements from memory into the the VectorizedArray @p out,
+ * Load size() data items from memory into the the VectorizedArray @p out,
* starting at the given addresses and with given offset, each entry from the
* offset providing one element of the vectorized array.
*
* This operation corresponds to the following code:
* @code
- * for (unsigned int v=0; v<VectorizedArray<Number>::n_array_elements; ++v)
+ * for (unsigned int v=0; v<VectorizedArray<Number>::size(); ++v)
* out.data[v] = ptrs[v][offset];
* @endcode
*/
/**
- * This method loads VectorizedArray::n_array_elements data streams from the
+ * This method loads VectorizedArray::size() data streams from the
* given array @p in. The offsets to the input array are given by the array @p
* offsets. From each stream, n_entries are read. The data is then transposed
* and stored it into an array of VectorizedArray type. The output array @p
*
* @code
* for (unsigned int i=0; i<n_entries; ++i)
- * for (unsigned int v=0; v<VectorizedArray<Number>::n_array_elements; ++v)
+ * for (unsigned int v=0; v<VectorizedArray<Number>::size(); ++v)
* out[i][v] = in[offsets[v]+i];
* @endcode
*
VectorizedArray<Number, width> *out)
{
for (unsigned int i = 0; i < n_entries; ++i)
- for (unsigned int v = 0;
- v < VectorizedArray<Number, width>::n_array_elements;
- ++v)
+ for (unsigned int v = 0; v < VectorizedArray<Number, width>::size(); ++v)
out[i][v] = in[offsets[v] + i];
}
VectorizedArray<Number, width> * out)
{
for (unsigned int i = 0; i < n_entries; ++i)
- for (unsigned int v = 0;
- v < VectorizedArray<Number, width>::n_array_elements;
- ++v)
+ for (unsigned int v = 0; v < VectorizedArray<Number, width>::size(); ++v)
out[i][v] = in[v][i];
}
*
* @code
* for (unsigned int i=0; i<n_entries; ++i)
- * for (unsigned int v=0; v<VectorizedArray<Number>::n_array_elements; ++v)
+ * for (unsigned int v=0; v<VectorizedArray<Number>::size(); ++v)
* out[offsets[v]+i] = in[i][v];
* @endcode
*
* action:
* @code
* for (unsigned int i=0; i<n_entries; ++i)
- * for (unsigned int v=0; v<VectorizedArray<Number>::n_array_elements; ++v)
+ * for (unsigned int v=0; v<VectorizedArray<Number>::size(); ++v)
* out[offsets[v]+i] += in[i][v];
* @endcode
*
{
if (add_into)
for (unsigned int i = 0; i < n_entries; ++i)
- for (unsigned int v = 0;
- v < VectorizedArray<Number, width>::n_array_elements;
- ++v)
+ for (unsigned int v = 0; v < VectorizedArray<Number, width>::size(); ++v)
out[offsets[v] + i] += in[i][v];
else
for (unsigned int i = 0; i < n_entries; ++i)
- for (unsigned int v = 0;
- v < VectorizedArray<Number, width>::n_array_elements;
- ++v)
+ for (unsigned int v = 0; v < VectorizedArray<Number, width>::size(); ++v)
out[offsets[v] + i] = in[i][v];
}
{
if (add_into)
for (unsigned int i = 0; i < n_entries; ++i)
- for (unsigned int v = 0;
- v < VectorizedArray<Number, width>::n_array_elements;
- ++v)
+ for (unsigned int v = 0; v < VectorizedArray<Number, width>::size(); ++v)
out[v][i] += in[i][v];
else
for (unsigned int i = 0; i < n_entries; ++i)
- for (unsigned int v = 0;
- v < VectorizedArray<Number, width>::n_array_elements;
- ++v)
+ for (unsigned int v = 0; v < VectorizedArray<Number, width>::size(); ++v)
out[v][i] = in[i][v];
}
*/
template <>
class VectorizedArray<double, 8>
- : public VectorizedArrayBase<VectorizedArray<double, 8>>
+ : public VectorizedArrayBase<VectorizedArray<double, 8>, 8>
{
public:
/**
/**
* This gives the number of vectors collected in this class.
*/
- static const unsigned int n_array_elements = 8;
+ DEAL_II_DEPRECATED static const unsigned int n_array_elements = 8;
/**
* Default empty constructor, leaving the data in an uninitialized state
}
/**
- * Load @p n_array_elements from memory into the calling class, starting at
+ * Load size() data items from memory into the calling class, starting at
* the given address. The memory need not be aligned by 64 bytes, as opposed
* to casting a double address to VectorizedArray<double>*.
*/
/**
* Write the content of the calling class into memory in form of @p
- * n_array_elements to the given address. The memory need not be aligned by
+ * size() to the given address. The memory need not be aligned by
* 64 bytes, as opposed to casting a double address to
* VectorizedArray<double>*.
*/
}
/**
- * Load @p n_array_elements from memory into the calling class, starting at
+ * Load @p size() from memory into the calling class, starting at
* the given address and with given offsets, each entry from the offset
* providing one element of the vectorized array.
*
* This operation corresponds to the following code (but uses a more
* efficient implementation in case the hardware allows for that):
* @code
- * for (unsigned int v=0; v<VectorizedArray<Number>::n_array_elements; ++v)
+ * for (unsigned int v=0; v<VectorizedArray<Number>::size(); ++v)
* this->operator[](v) = base_ptr[offsets[v]];
* @endcode
*/
/**
* Write the content of the calling class into memory in form of @p
- * n_array_elements to the given address and the given offsets, filling the
+ * size() to the given address and the given offsets, filling the
* elements of the vectorized array into each offset.
*
* This operation corresponds to the following code (but uses a more
* efficient implementation in case the hardware allows for that):
* @code
- * for (unsigned int v=0; v<VectorizedArray<Number>::n_array_elements; ++v)
+ * for (unsigned int v=0; v<VectorizedArray<Number>::size(); ++v)
* base_ptr[offsets[v]] = this->operator[](v);
* @endcode
*/
*/
template <>
class VectorizedArray<float, 16>
- : public VectorizedArrayBase<VectorizedArray<float, 16>>
+ : public VectorizedArrayBase<VectorizedArray<float, 16>, 16>
{
public:
/**
/**
* This gives the number of vectors collected in this class.
*/
- static const unsigned int n_array_elements = 16;
+ DEAL_II_DEPRECATED static const unsigned int n_array_elements = 16;
/**
* Default empty constructor, leaving the data in an uninitialized state
}
/**
- * Load @p n_array_elements from memory into the calling class, starting at
+ * Load @p size() from memory into the calling class, starting at
* the given address. The memory need not be aligned by 64 bytes, as opposed
* to casting a float address to VectorizedArray<float>*.
*/
/**
* Write the content of the calling class into memory in form of @p
- * n_array_elements to the given address. The memory need not be aligned by
+ * size() to the given address. The memory need not be aligned by
* 64 bytes, as opposed to casting a float address to
* VectorizedArray<float>*.
*/
}
/**
- * Load @p n_array_elements from memory into the calling class, starting at
+ * Load @p size() from memory into the calling class, starting at
* the given address and with given offsets, each entry from the offset
* providing one element of the vectorized array.
*
* This operation corresponds to the following code (but uses a more
* efficient implementation in case the hardware allows for that):
* @code
- * for (unsigned int v=0; v<VectorizedArray<Number>::n_array_elements; ++v)
+ * for (unsigned int v=0; v<VectorizedArray<Number>::size(); ++v)
* this->operator[](v) = base_ptr[offsets[v]];
* @endcode
*/
/**
* Write the content of the calling class into memory in form of @p
- * n_array_elements to the given address and the given offsets, filling the
+ * size() to the given address and the given offsets, filling the
* elements of the vectorized array into each offset.
*
* This operation corresponds to the following code (but uses a more
* efficient implementation in case the hardware allows for that):
* @code
- * for (unsigned int v=0; v<VectorizedArray<Number>::n_array_elements; ++v)
+ * for (unsigned int v=0; v<VectorizedArray<Number>::size(); ++v)
* base_ptr[offsets[v]] = this->operator[](v);
* @endcode
*/
*/
template <>
class VectorizedArray<double, 4>
- : public VectorizedArrayBase<VectorizedArray<double, 4>>
+ : public VectorizedArrayBase<VectorizedArray<double, 4>, 4>
{
public:
/**
/**
* This gives the number of vectors collected in this class.
*/
- static const unsigned int n_array_elements = 4;
+ DEAL_II_DEPRECATED static const unsigned int n_array_elements = 4;
/**
* Default empty constructor, leaving the data in an uninitialized state
}
/**
- * Load @p n_array_elements from memory into the calling class, starting at
+ * Load @p size() from memory into the calling class, starting at
* the given address. The memory need not be aligned by 32 bytes, as opposed
* to casting a double address to VectorizedArray<double>*.
*/
/**
* Write the content of the calling class into memory in form of @p
- * n_array_elements to the given address. The memory need not be aligned by
+ * size() to the given address. The memory need not be aligned by
* 32 bytes, as opposed to casting a double address to
* VectorizedArray<double>*.
*/
}
/**
- * Load @p n_array_elements from memory into the calling class, starting at
+ * Load @p size() from memory into the calling class, starting at
* the given address and with given offsets, each entry from the offset
* providing one element of the vectorized array.
*
* This operation corresponds to the following code (but uses a more
* efficient implementation in case the hardware allows for that):
* @code
- * for (unsigned int v=0; v<VectorizedArray<Number>::n_array_elements; ++v)
+ * for (unsigned int v=0; v<VectorizedArray<Number>::size(); ++v)
* this->operator[](v) = base_ptr[offsets[v]];
* @endcode
*/
/**
* Write the content of the calling class into memory in form of @p
- * n_array_elements to the given address and the given offsets, filling the
+ * size() to the given address and the given offsets, filling the
* elements of the vectorized array into each offset.
*
* This operation corresponds to the following code (but uses a more
* efficient implementation in case the hardware allows for that):
* @code
- * for (unsigned int v=0; v<VectorizedArray<Number>::n_array_elements; ++v)
+ * for (unsigned int v=0; v<VectorizedArray<Number>::size(); ++v)
* base_ptr[offsets[v]] = this->operator[](v);
* @endcode
*/
*/
template <>
class VectorizedArray<float, 8>
- : public VectorizedArrayBase<VectorizedArray<float, 8>>
+ : public VectorizedArrayBase<VectorizedArray<float, 8>, 8>
{
public:
/**
/**
* This gives the number of vectors collected in this class.
*/
- static const unsigned int n_array_elements = 8;
+ DEAL_II_DEPRECATED static const unsigned int n_array_elements = 8;
/**
* Default empty constructor, leaving the data in an uninitialized state
}
/**
- * Load @p n_array_elements from memory into the calling class, starting at
+ * Load @p size() from memory into the calling class, starting at
* the given address. The memory need not be aligned by 32 bytes, as opposed
* to casting a float address to VectorizedArray<float>*.
*/
/**
* Write the content of the calling class into memory in form of @p
- * n_array_elements to the given address. The memory need not be aligned by
+ * size() to the given address. The memory need not be aligned by
* 32 bytes, as opposed to casting a float address to
* VectorizedArray<float>*.
*/
}
/**
- * Load @p n_array_elements from memory into the calling class, starting at
+ * Load @p size() from memory into the calling class, starting at
* the given address and with given offsets, each entry from the offset
* providing one element of the vectorized array.
*
* This operation corresponds to the following code (but uses a more
* efficient implementation in case the hardware allows for that):
* @code
- * for (unsigned int v=0; v<VectorizedArray<Number>::n_array_elements; ++v)
+ * for (unsigned int v=0; v<VectorizedArray<Number>::size(); ++v)
* this->operator[](v) = base_ptr[offsets[v]];
* @endcode
*/
/**
* Write the content of the calling class into memory in form of @p
- * n_array_elements to the given address and the given offsets, filling the
+ * size() to the given address and the given offsets, filling the
* elements of the vectorized array into each offset.
*
* This operation corresponds to the following code (but uses a more
* efficient implementation in case the hardware allows for that):
* @code
- * for (unsigned int v=0; v<VectorizedArray<Number>::n_array_elements; ++v)
+ * for (unsigned int v=0; v<VectorizedArray<Number>::size(); ++v)
* base_ptr[offsets[v]] = this->operator[](v);
* @endcode
*/
*/
template <>
class VectorizedArray<double, 2>
- : public VectorizedArrayBase<VectorizedArray<double, 2>>
+ : public VectorizedArrayBase<VectorizedArray<double, 2>, 2>
{
public:
/**
/**
* This gives the number of vectors collected in this class.
*/
- static const unsigned int n_array_elements = 2;
+ DEAL_II_DEPRECATED static const unsigned int n_array_elements = 2;
/**
* Default empty constructor, leaving the data in an uninitialized state
}
/**
- * Load @p n_array_elements from memory into the calling class, starting at
+ * Load @p size() from memory into the calling class, starting at
* the given address. The memory need not be aligned by 16 bytes, as opposed
* to casting a double address to VectorizedArray<double>*.
*/
/**
* Write the content of the calling class into memory in form of @p
- * n_array_elements to the given address. The memory need not be aligned by
+ * size() to the given address. The memory need not be aligned by
* 16 bytes, as opposed to casting a double address to
* VectorizedArray<double>*.
*/
}
/**
- * Load @p n_array_elements from memory into the calling class, starting at
+ * Load @p size() from memory into the calling class, starting at
* the given address and with given offsets, each entry from the offset
* providing one element of the vectorized array.
*
* This operation corresponds to the following code (but uses a more
* efficient implementation in case the hardware allows for that):
* @code
- * for (unsigned int v=0; v<VectorizedArray<Number>::n_array_elements; ++v)
+ * for (unsigned int v=0; v<VectorizedArray<Number>::size(); ++v)
* this->operator[](v) = base_ptr[offsets[v]];
* @endcode
*/
/**
* Write the content of the calling class into memory in form of @p
- * n_array_elements to the given address and the given offsets, filling the
+ * size() to the given address and the given offsets, filling the
* elements of the vectorized array into each offset.
*
* This operation corresponds to the following code (but uses a more
* efficient implementation in case the hardware allows for that):
* @code
- * for (unsigned int v=0; v<VectorizedArray<Number>::n_array_elements; ++v)
+ * for (unsigned int v=0; v<VectorizedArray<Number>::size(); ++v)
* base_ptr[offsets[v]] = this->operator[](v);
* @endcode
*/
*/
template <>
class VectorizedArray<float, 4>
- : public VectorizedArrayBase<VectorizedArray<float, 4>>
+ : public VectorizedArrayBase<VectorizedArray<float, 4>, 4>
{
public:
/**
/**
* This gives the number of vectors collected in this class.
*/
- static const unsigned int n_array_elements = 4;
+ DEAL_II_DEPRECATED static const unsigned int n_array_elements = 4;
/**
* This function can be used to set all data fields to a given scalar.
}
/**
- * Load @p n_array_elements from memory into the calling class, starting at
+ * Load @p size() from memory into the calling class, starting at
* the given address. The memory need not be aligned by 16 bytes, as opposed
* to casting a float address to VectorizedArray<float>*.
*/
/**
* Write the content of the calling class into memory in form of @p
- * n_array_elements to the given address. The memory need not be aligned by
+ * size() to the given address. The memory need not be aligned by
* 16 bytes, as opposed to casting a float address to
* VectorizedArray<float>*.
*/
}
/**
- * Load @p n_array_elements from memory into the calling class, starting at
+ * Load @p size() from memory into the calling class, starting at
* the given address and with given offsets, each entry from the offset
* providing one element of the vectorized array.
*
* This operation corresponds to the following code (but uses a more
* efficient implementation in case the hardware allows for that):
* @code
- * for (unsigned int v=0; v<VectorizedArray<Number>::n_array_elements; ++v)
+ * for (unsigned int v=0; v<VectorizedArray<Number>::size(); ++v)
* this->operator[](v) = base_ptr[offsets[v]];
* @endcode
*/
/**
* Write the content of the calling class into memory in form of @p
- * n_array_elements to the given address and the given offsets, filling the
+ * size() to the given address and the given offsets, filling the
* elements of the vectorized array into each offset.
*
* This operation corresponds to the following code (but uses a more
* efficient implementation in case the hardware allows for that):
* @code
- * for (unsigned int v=0; v<VectorizedArray<Number>::n_array_elements; ++v)
+ * for (unsigned int v=0; v<VectorizedArray<Number>::size(); ++v)
* base_ptr[offsets[v]] = this->operator[](v);
* @endcode
*/
template <>
class VectorizedArray<double, 2>
- : public VectorizedArrayBase<VectorizedArray<double, 2>>
+ : public VectorizedArrayBase<VectorizedArray<double, 2>, 2>
{
public:
/**
/**
* This gives the number of vectors collected in this class.
*/
- static const unsigned int n_array_elements = 2;
+ DEAL_II_DEPRECATED static const unsigned int n_array_elements = 2;
/**
* Default empty constructor, leaving the data in an uninitialized state
}
/**
- * Load @p n_array_elements from memory into the calling class, starting at
+ * Load @p size() from memory into the calling class, starting at
* the given address.
*/
DEAL_II_ALWAYS_INLINE
/**
* Write the content of the calling class into memory in form of @p
- * n_array_elements to the given address.
+ * size() to the given address.
*/
DEAL_II_ALWAYS_INLINE
void
template <>
class VectorizedArray<float, 4>
- : public VectorizedArrayBase<VectorizedArray<float, 4>>
+ : public VectorizedArrayBase<VectorizedArray<float, 4>, 4>
{
public:
/**
/**
* This gives the number of vectors collected in this class.
*/
- static const unsigned int n_array_elements = 4;
+ DEAL_II_DEPRECATED static const unsigned int n_array_elements = 4;
/**
* Default empty constructor, leaving the data in an uninitialized state
}
/**
- * Load @p n_array_elements from memory into the calling class, starting at
+ * Load @p size() from memory into the calling class, starting at
* the given address.
*/
DEAL_II_ALWAYS_INLINE
/**
* Write the content of the calling class into memory in form of @p
- * n_array_elements to the given address.
+ * size() to the given address.
*/
DEAL_II_ALWAYS_INLINE
void
operator==(const VectorizedArray<Number, width> &lhs,
const VectorizedArray<Number, width> &rhs)
{
- for (unsigned int i = 0; i < VectorizedArray<Number, width>::n_array_elements;
- ++i)
+ for (unsigned int i = 0; i < VectorizedArray<Number, width>::size(); ++i)
if (lhs[i] != rhs[i])
return false;
/**
* Addition of a scalar (expanded to a vectorized array with @p
- * n_array_elements equal entries) and a vectorized array.
+ * size() equal entries) and a vectorized array.
*
* @relatesalso VectorizedArray
*/
/**
* Addition of a scalar (expanded to a vectorized array with @p
- * n_array_elements equal entries) and a vectorized array in case the scalar
+ * size() equal entries) and a vectorized array in case the scalar
* is a double (needed in order to be able to write simple code with constants
* that are usually double numbers).
*
/**
* Addition of a vectorized array and a scalar (expanded to a vectorized array
- * with @p n_array_elements equal entries).
+ * with @p size() equal entries).
*
* @relatesalso VectorizedArray
*/
/**
* Addition of a vectorized array and a scalar (expanded to a vectorized array
- * with @p n_array_elements equal entries) in case the scalar is a double
+ * with @p size() equal entries) in case the scalar is a double
* (needed in order to be able to write simple code with constants that are
* usually double numbers).
*
/**
* Subtraction of a vectorized array from a scalar (expanded to a vectorized
- * array with @p n_array_elements equal entries).
+ * array with @p size() equal entries).
*
* @relatesalso VectorizedArray
*/
/**
* Subtraction of a vectorized array from a scalar (expanded to a vectorized
- * array with @p n_array_elements equal entries) in case the scalar is a
+ * array with @p size() equal entries) in case the scalar is a
* double (needed in order to be able to write simple code with constants that
* are usually double numbers).
*
/**
* Subtraction of a scalar (expanded to a vectorized array with @p
- * n_array_elements equal entries) from a vectorized array.
+ * size() equal entries) from a vectorized array.
*
* @relatesalso VectorizedArray
*/
/**
* Subtraction of a scalar (expanded to a vectorized array with @p
- * n_array_elements equal entries) from a vectorized array in case the scalar
+ * size() equal entries) from a vectorized array in case the scalar
* is a double (needed in order to be able to write simple code with constants
* that are usually double numbers).
*
/**
* Multiplication of a scalar (expanded to a vectorized array with @p
- * n_array_elements equal entries) and a vectorized array.
+ * size() equal entries) and a vectorized array.
*
* @relatesalso VectorizedArray
*/
/**
* Multiplication of a scalar (expanded to a vectorized array with @p
- * n_array_elements equal entries) and a vectorized array in case the scalar
+ * size() equal entries) and a vectorized array in case the scalar
* is a double (needed in order to be able to write simple code with constants
* that are usually double numbers).
*
/**
* Multiplication of a vectorized array and a scalar (expanded to a vectorized
- * array with @p n_array_elements equal entries).
+ * array with @p size() equal entries).
*
* @relatesalso VectorizedArray
*/
/**
* Multiplication of a vectorized array and a scalar (expanded to a vectorized
- * array with @p n_array_elements equal entries) in case the scalar is a
+ * array with @p size() equal entries) in case the scalar is a
* double (needed in order to be able to write simple code with constants that
* are usually double numbers).
*
/**
* Quotient between a scalar (expanded to a vectorized array with @p
- * n_array_elements equal entries) and a vectorized array.
+ * size() equal entries) and a vectorized array.
*
* @relatesalso VectorizedArray
*/
/**
* Quotient between a scalar (expanded to a vectorized array with @p
- * n_array_elements equal entries) and a vectorized array in case the scalar
+ * size() equal entries) and a vectorized array in case the scalar
* is a double (needed in order to be able to write simple code with constants
* that are usually double numbers).
*
/**
* Quotient between a vectorized array and a scalar (expanded to a vectorized
- * array with @p n_array_elements equal entries).
+ * array with @p size() equal entries).
*
* @relatesalso VectorizedArray
*/
/**
* Quotient between a vectorized array and a scalar (expanded to a vectorized
- * array with @p n_array_elements equal entries) in case the scalar is a
+ * array with @p size() equal entries) in case the scalar is a
* double (needed in order to be able to write simple code with constants that
* are usually double numbers).
*
inline std::ostream &
operator<<(std::ostream &out, const VectorizedArray<Number, width> &p)
{
- constexpr unsigned int n = VectorizedArray<Number, width>::n_array_elements;
+ constexpr unsigned int n = VectorizedArray<Number, width>::size();
for (unsigned int i = 0; i < n - 1; ++i)
out << p[i] << ' ';
out << p[n - 1];
/**
* Compute the sine of a vectorized data field. The result is returned as
* vectorized array in the form <tt>{sin(x[0]), sin(x[1]), ...,
- * sin(x[n_array_elements-1])}</tt>.
+ * sin(x[VectorizedArray::size()-1])}</tt>.
*
* @relatesalso VectorizedArray
*/
// setting the individual elements and also circumvents a compiler
// optimization bug in gcc-4.6 with SSE2 (see also deal.II developers list
// from April 2014, topic "matrix_free/step-48 Test").
- Number values[::dealii::VectorizedArray<Number, width>::n_array_elements];
- for (unsigned int i = 0;
- i < dealii::VectorizedArray<Number, width>::n_array_elements;
+ Number values[::dealii::VectorizedArray<Number, width>::size()];
+ for (unsigned int i = 0; i < dealii::VectorizedArray<Number, width>::size();
++i)
values[i] = std::sin(x[i]);
::dealii::VectorizedArray<Number, width> out;
/**
* Compute the cosine of a vectorized data field. The result is returned as
* vectorized array in the form <tt>{cos(x[0]), cos(x[1]), ...,
- * cos(x[n_array_elements-1])}</tt>.
+ * cos(x[size()-1])}</tt>.
*
* @relatesalso VectorizedArray
*/
inline ::dealii::VectorizedArray<Number, width>
cos(const ::dealii::VectorizedArray<Number, width> &x)
{
- Number values[::dealii::VectorizedArray<Number, width>::n_array_elements];
- for (unsigned int i = 0;
- i < dealii::VectorizedArray<Number, width>::n_array_elements;
+ Number values[::dealii::VectorizedArray<Number, width>::size()];
+ for (unsigned int i = 0; i < dealii::VectorizedArray<Number, width>::size();
++i)
values[i] = std::cos(x[i]);
::dealii::VectorizedArray<Number, width> out;
/**
* Compute the tangent of a vectorized data field. The result is returned
* as vectorized array in the form <tt>{tan(x[0]), tan(x[1]), ...,
- * tan(x[n_array_elements-1])}</tt>.
+ * tan(x[size()-1])}</tt>.
*
* @relatesalso VectorizedArray
*/
inline ::dealii::VectorizedArray<Number, width>
tan(const ::dealii::VectorizedArray<Number, width> &x)
{
- Number values[::dealii::VectorizedArray<Number, width>::n_array_elements];
- for (unsigned int i = 0;
- i < dealii::VectorizedArray<Number, width>::n_array_elements;
+ Number values[::dealii::VectorizedArray<Number, width>::size()];
+ for (unsigned int i = 0; i < dealii::VectorizedArray<Number, width>::size();
++i)
values[i] = std::tan(x[i]);
::dealii::VectorizedArray<Number, width> out;
/**
* Compute the exponential of a vectorized data field. The result is
* returned as vectorized array in the form <tt>{exp(x[0]), exp(x[1]), ...,
- * exp(x[n_array_elements-1])}</tt>.
+ * exp(x[size()-1])}</tt>.
*
* @relatesalso VectorizedArray
*/
inline ::dealii::VectorizedArray<Number, width>
exp(const ::dealii::VectorizedArray<Number, width> &x)
{
- Number values[::dealii::VectorizedArray<Number, width>::n_array_elements];
- for (unsigned int i = 0;
- i < dealii::VectorizedArray<Number, width>::n_array_elements;
+ Number values[::dealii::VectorizedArray<Number, width>::size()];
+ for (unsigned int i = 0; i < dealii::VectorizedArray<Number, width>::size();
++i)
values[i] = std::exp(x[i]);
::dealii::VectorizedArray<Number, width> out;
/**
* Compute the natural logarithm of a vectorized data field. The result is
* returned as vectorized array in the form <tt>{log(x[0]), log(x[1]), ...,
- * log(x[n_array_elements-1])}</tt>.
+ * log(x[size()-1])}</tt>.
*
* @relatesalso VectorizedArray
*/
inline ::dealii::VectorizedArray<Number, width>
log(const ::dealii::VectorizedArray<Number, width> &x)
{
- Number values[::dealii::VectorizedArray<Number, width>::n_array_elements];
- for (unsigned int i = 0;
- i < dealii::VectorizedArray<Number, width>::n_array_elements;
+ Number values[::dealii::VectorizedArray<Number, width>::size()];
+ for (unsigned int i = 0; i < dealii::VectorizedArray<Number, width>::size();
++i)
values[i] = std::log(x[i]);
::dealii::VectorizedArray<Number, width> out;
/**
* Compute the square root of a vectorized data field. The result is
* returned as vectorized array in the form <tt>{sqrt(x[0]), sqrt(x[1]),
- * ..., sqrt(x[n_array_elements-1])}</tt>.
+ * ..., sqrt(x[size()-1])}</tt>.
*
* @relatesalso VectorizedArray
*/
/**
* Raises the given number @p x to the power @p p for a vectorized data
* field. The result is returned as vectorized array in the form
- * <tt>{pow(x[0],p), pow(x[1],p), ..., pow(x[n_array_elements-1],p)}</tt>.
+ * <tt>{pow(x[0],p), pow(x[1],p), ..., pow(x[size()-1],p)}</tt>.
*
* @relatesalso VectorizedArray
*/
inline ::dealii::VectorizedArray<Number, width>
pow(const ::dealii::VectorizedArray<Number, width> &x, const Number p)
{
- Number values[::dealii::VectorizedArray<Number, width>::n_array_elements];
- for (unsigned int i = 0;
- i < dealii::VectorizedArray<Number, width>::n_array_elements;
+ Number values[::dealii::VectorizedArray<Number, width>::size()];
+ for (unsigned int i = 0; i < dealii::VectorizedArray<Number, width>::size();
++i)
values[i] = std::pow(x[i], p);
::dealii::VectorizedArray<Number, width> out;
/**
* Compute the absolute value (modulus) of a vectorized data field. The
* result is returned as vectorized array in the form <tt>{abs(x[0]),
- * abs(x[1]), ..., abs(x[n_array_elements-1])}</tt>.
+ * abs(x[1]), ..., abs(x[size()-1])}</tt>.
*
* @relatesalso VectorizedArray
*/
this->mass_matrix = mass_matrix;
this->derivative_matrix = derivative_matrix;
- constexpr unsigned int macro_size = VectorizedArray<Number>::n_array_elements;
+ constexpr unsigned int macro_size = VectorizedArray<Number>::size();
std::size_t n_rows_max = (n_rows_1d > 0) ? n_rows_1d : 0;
if (n_rows_1d == -1)
for (unsigned int d = 0; d < dim; ++d)
template <typename Number, typename Number2>
struct Dot
{
- static const bool vectorizes =
- std::is_same<Number, Number2>::value &&
- (VectorizedArray<Number>::n_array_elements > 1);
+ static constexpr bool vectorizes = std::is_same<Number, Number2>::value &&
+ (VectorizedArray<Number>::size() > 1);
Dot(const Number *const X, const Number2 *const Y)
: X(X)
template <typename Number, typename RealType>
struct Norm2
{
- static const bool vectorizes =
- VectorizedArray<Number>::n_array_elements > 1;
+ static const bool vectorizes = VectorizedArray<Number>::size() > 1;
Norm2(const Number *const X)
: X(X)
template <typename Number, typename RealType>
struct Norm1
{
- static const bool vectorizes =
- VectorizedArray<Number>::n_array_elements > 1;
+ static const bool vectorizes = VectorizedArray<Number>::size() > 1;
Norm1(const Number *X)
: X(X)
template <typename Number, typename RealType>
struct NormP
{
- static const bool vectorizes =
- VectorizedArray<Number>::n_array_elements > 1;
+ static const bool vectorizes = VectorizedArray<Number>::size() > 1;
NormP(const Number *X, RealType p)
: X(X)
template <typename Number>
struct MeanValue
{
- static const bool vectorizes =
- VectorizedArray<Number>::n_array_elements > 1;
+ static const bool vectorizes = VectorizedArray<Number>::size() > 1;
MeanValue(const Number *X)
: X(X)
template <typename Number>
struct AddAndDot
{
- static const bool vectorizes =
- VectorizedArray<Number>::n_array_elements > 1;
+ static const bool vectorizes = VectorizedArray<Number>::size() > 1;
AddAndDot(Number *const X,
const Number *const V,
// First we work on (n_chunks/nvecs) chunks, where each chunk processes
// nvecs*(4*8) elements.
- const unsigned int nvecs = VectorizedArray<Number>::n_array_elements;
- const size_type regular_chunks = n_chunks / nvecs;
+ constexpr unsigned int nvecs = VectorizedArray<Number>::size();
+ const size_type regular_chunks = n_chunks / nvecs;
for (size_type i = 0; i < regular_chunks; ++i)
{
VectorizedArray<Number> r0 = op.do_vectorized(index);
r0 += r1;
r2 += r3;
r0 += r2;
- r0.store(
- &outer_results[i * VectorizedArray<Number>::n_array_elements]);
+ r0.store(&outer_results[i * nvecs]);
}
// If we are treating a case where the vector length is not divisible by
// regular_chunks * nvecs; We do as much as possible with 2 SIMD
// operations within each chunk. Here we assume that nvecs < 32/2 = 16 as
// well as 16%nvecs==0.
- AssertIndexRange(VectorizedArray<Number>::n_array_elements, 17);
+ static_assert(
+ VectorizedArray<Number>::size() <= 16 &&
+ 16 % VectorizedArray<Number>::size() == 0,
+ "VectorizedArray::size() must be a power of 2 and not more than 16");
Assert(16 % nvecs == 0, ExcInternalError());
- if (n_chunks % VectorizedArray<Number>::n_array_elements != 0)
+ if (n_chunks % nvecs != 0)
{
VectorizedArray<Number> r0 = VectorizedArray<Number>(),
r1 = VectorizedArray<Number>();
r0.store(&outer_results[start_irreg]);
// update n_chunks to denote unused element in outer_results[] from
// which we can keep writing.
- n_chunks = start_irreg + VectorizedArray<Number>::n_array_elements;
+ n_chunks = start_irreg + VectorizedArray<Number>::size();
}
}
* cells batched together. As opposed to the other classes which are
* templated on the number type, this class as a pure index container is
* not templated, so we need to keep the information otherwise contained
- * in VectorizedArrayType::n_array_elements.
+ * in VectorizedArrayType::size().
*/
unsigned int vectorization_length;
void
do_vectorized_read(const Number2 *src_ptr, VectorizedArrayType &dst)
{
- for (unsigned int v = 0; v < VectorizedArrayType::n_array_elements; ++v)
+ for (unsigned int v = 0; v < VectorizedArrayType::size(); ++v)
dst[v] = src_ptr[v];
}
const unsigned int * indices,
VectorizedArrayType &dst)
{
- for (unsigned int v = 0; v < VectorizedArrayType::n_array_elements; ++v)
+ for (unsigned int v = 0; v < VectorizedArrayType::size(); ++v)
dst[v] = src_ptr[indices[v]];
}
void
do_vectorized_add(const VectorizedArrayType src, Number2 *dst_ptr)
{
- for (unsigned int v = 0; v < VectorizedArrayType::n_array_elements; ++v)
+ for (unsigned int v = 0; v < VectorizedArrayType::size(); ++v)
dst_ptr[v] += src[v];
}
const unsigned int * indices,
Number2 * dst_ptr)
{
- for (unsigned int v = 0; v < VectorizedArrayType::n_array_elements; ++v)
+ for (unsigned int v = 0; v < VectorizedArrayType::size(); ++v)
dst_ptr[indices[v]] += src[v];
}
{
AssertDimension(
dof_info.n_vectorization_lanes_filled[dof_access_index][cell],
- VectorizedArrayType::n_array_elements);
+ VectorizedArrayType::size());
const unsigned int dof_index =
- dof_info.dof_indices_contiguous
- [dof_access_index][cell * VectorizedArrayType::n_array_elements] +
+ dof_info
+ .dof_indices_contiguous[dof_access_index]
+ [cell * VectorizedArrayType::size()] +
dof_info.component_dof_indices_offset[active_fe_index]
[first_selected_component] *
- VectorizedArrayType::n_array_elements;
+ VectorizedArrayType::size();
if (fe_degree > 1 && evaluate_gradients == true)
{
AssertIndexRange(ind2, data.dofs_per_component_on_cell);
for (unsigned int comp = 0; comp < n_components; ++comp)
{
- do_vectorized_read(
- src_ptr + dof_index +
- (ind1 + comp * static_dofs_per_component) *
- VectorizedArrayType::n_array_elements,
- temp1[i + 2 * comp * dofs_per_face]);
+ do_vectorized_read(src_ptr + dof_index +
+ (ind1 +
+ comp * static_dofs_per_component) *
+ VectorizedArrayType::size(),
+ temp1[i + 2 * comp * dofs_per_face]);
do_vectorized_read(
src_ptr + dof_index +
(ind2 + comp * static_dofs_per_component) *
- VectorizedArrayType::n_array_elements,
+ VectorizedArrayType::size(),
temp1[dofs_per_face + i + 2 * comp * dofs_per_face]);
temp1[i + dofs_per_face + 2 * comp * dofs_per_face] =
grad_weight *
{
const unsigned int ind = index_array[i];
for (unsigned int comp = 0; comp < n_components; ++comp)
- do_vectorized_read(
- src_ptr + dof_index +
- (ind + comp * static_dofs_per_component) *
- VectorizedArrayType::n_array_elements,
- temp1[i + 2 * comp * dofs_per_face]);
+ do_vectorized_read(src_ptr + dof_index +
+ (ind +
+ comp * static_dofs_per_component) *
+ VectorizedArrayType::size(),
+ temp1[i + 2 * comp * dofs_per_face]);
}
}
}
{
AssertDimension(
dof_info.n_vectorization_lanes_filled[dof_access_index][cell],
- VectorizedArrayType::n_array_elements);
+ VectorizedArrayType::size());
const unsigned int *indices =
- &dof_info.dof_indices_contiguous
- [dof_access_index][cell * VectorizedArrayType::n_array_elements];
+ &dof_info
+ .dof_indices_contiguous[dof_access_index]
+ [cell * VectorizedArrayType::size()];
if (fe_degree > 1 && evaluate_gradients == true)
{
// we know that the gradient weights for the Hermite case on the
for (unsigned int i = 0; i < dofs_per_face; ++i)
{
const unsigned int ind1 =
- index_array[2 * i] * VectorizedArrayType::n_array_elements;
+ index_array[2 * i] * VectorizedArrayType::size();
const unsigned int ind2 =
- index_array[2 * i + 1] *
- VectorizedArrayType::n_array_elements;
+ index_array[2 * i + 1] * VectorizedArrayType::size();
for (unsigned int comp = 0; comp < n_components; ++comp)
{
do_vectorized_gather(
src_ptr + ind1 +
comp * static_dofs_per_component *
- VectorizedArrayType::n_array_elements +
+ VectorizedArrayType::size() +
dof_info.component_dof_indices_offset
[active_fe_index][first_selected_component] *
- VectorizedArrayType::n_array_elements,
+ VectorizedArrayType::size(),
indices,
temp1[i + 2 * comp * dofs_per_face]);
VectorizedArrayType grad;
do_vectorized_gather(
src_ptr + ind2 +
comp * static_dofs_per_component *
- VectorizedArrayType::n_array_elements +
+ VectorizedArrayType::size() +
dof_info.component_dof_indices_offset
[active_fe_index][first_selected_component] *
- VectorizedArrayType::n_array_elements,
+ VectorizedArrayType::size(),
indices,
grad);
temp1[i + dofs_per_face + 2 * comp * dofs_per_face] =
for (unsigned int i = 0; i < dofs_per_face; ++i)
{
const unsigned int ind =
- index_array[i] * VectorizedArrayType::n_array_elements;
+ index_array[i] * VectorizedArrayType::size();
for (unsigned int comp = 0; comp < n_components; ++comp)
do_vectorized_gather(
src_ptr + ind +
comp * static_dofs_per_component *
- VectorizedArrayType::n_array_elements +
+ VectorizedArrayType::size() +
dof_info.component_dof_indices_offset
[active_fe_index][first_selected_component] *
- VectorizedArrayType::n_array_elements,
+ VectorizedArrayType::size(),
indices,
temp1[i + 2 * comp * dofs_per_face]);
}
{
const unsigned int *strides =
&dof_info.dof_indices_interleave_strides
- [dof_access_index][cell * VectorizedArrayType::n_array_elements];
- unsigned int indices[VectorizedArrayType::n_array_elements];
- for (unsigned int v = 0; v < VectorizedArrayType::n_array_elements;
- ++v)
+ [dof_access_index][cell * VectorizedArrayType::size()];
+ unsigned int indices[VectorizedArrayType::size()];
+ for (unsigned int v = 0; v < VectorizedArrayType::size(); ++v)
indices[v] =
dof_info.dof_indices_contiguous
- [dof_access_index]
- [cell * VectorizedArrayType::n_array_elements + v] +
+ [dof_access_index][cell * VectorizedArrayType::size() + v] +
dof_info.component_dof_indices_offset[active_fe_index]
[first_selected_component] *
strides[v];
const unsigned int *index_array =
&data.face_to_cell_index_hermite(face_no, 0);
- if (nvec == VectorizedArrayType::n_array_elements)
+ if (nvec == VectorizedArrayType::size())
for (unsigned int comp = 0; comp < n_components; ++comp)
for (unsigned int i = 0; i < dofs_per_face; ++i)
{
- unsigned int ind1[VectorizedArrayType::n_array_elements];
+ unsigned int ind1[VectorizedArrayType::size()];
DEAL_II_OPENMP_SIMD_PRAGMA
- for (unsigned int v = 0;
- v < VectorizedArrayType::n_array_elements;
+ for (unsigned int v = 0; v < VectorizedArrayType::size();
++v)
ind1[v] =
indices[v] + (comp * static_dofs_per_component +
index_array[2 * i]) *
strides[v];
- unsigned int ind2[VectorizedArrayType::n_array_elements];
+ unsigned int ind2[VectorizedArrayType::size()];
DEAL_II_OPENMP_SIMD_PRAGMA
- for (unsigned int v = 0;
- v < VectorizedArrayType::n_array_elements;
+ for (unsigned int v = 0; v < VectorizedArrayType::size();
++v)
ind2[v] =
indices[v] + (comp * static_dofs_per_component +
dofs_per_face);
const unsigned int *index_array =
&data.face_to_cell_index_nodal(face_no, 0);
- if (nvec == VectorizedArrayType::n_array_elements)
+ if (nvec == VectorizedArrayType::size())
for (unsigned int comp = 0; comp < n_components; ++comp)
for (unsigned int i = 0; i < dofs_per_face; ++i)
{
- unsigned int ind[VectorizedArrayType::n_array_elements];
+ unsigned int ind[VectorizedArrayType::size()];
DEAL_II_OPENMP_SIMD_PRAGMA
- for (unsigned int v = 0;
- v < VectorizedArrayType::n_array_elements;
+ for (unsigned int v = 0; v < VectorizedArrayType::size();
++v)
ind[v] =
indices[v] +
MatrixFreeFunctions::DoFInfo::IndexStorageVariants::
contiguous &&
dof_info.n_vectorization_lanes_filled[dof_access_index][cell] ==
- VectorizedArrayType::n_array_elements)
+ VectorizedArrayType::size())
{
const unsigned int *indices =
- &dof_info.dof_indices_contiguous
- [dof_access_index][cell * VectorizedArrayType::n_array_elements];
+ &dof_info
+ .dof_indices_contiguous[dof_access_index]
+ [cell * VectorizedArrayType::size()];
if (evaluate_gradients == true &&
data.element_type ==
MatrixFreeFunctions::tensor_symmetric_hermite)
{
AssertDimension(
dof_info.n_vectorization_lanes_filled[dof_access_index][cell],
- VectorizedArrayType::n_array_elements);
+ VectorizedArrayType::size());
const unsigned int dof_index =
- dof_info.dof_indices_contiguous
- [dof_access_index][cell * VectorizedArrayType::n_array_elements] +
+ dof_info
+ .dof_indices_contiguous[dof_access_index]
+ [cell * VectorizedArrayType::size()] +
dof_info.component_dof_indices_offset[active_fe_index]
[first_selected_component] *
- VectorizedArrayType::n_array_elements;
+ VectorizedArrayType::size();
if (fe_degree > 1 && integrate_gradients == true)
{
VectorizedArrayType grad =
grad_weight *
temp1[i + dofs_per_face + 2 * comp * dofs_per_face];
- do_vectorized_add(
- val,
- dst_ptr + dof_index +
- (ind1 + comp * static_dofs_per_component) *
- VectorizedArrayType::n_array_elements);
- do_vectorized_add(
- grad,
- dst_ptr + dof_index +
- (ind2 + comp * static_dofs_per_component) *
- VectorizedArrayType::n_array_elements);
+ do_vectorized_add(val,
+ dst_ptr + dof_index +
+ (ind1 +
+ comp * static_dofs_per_component) *
+ VectorizedArrayType::size());
+ do_vectorized_add(grad,
+ dst_ptr + dof_index +
+ (ind2 +
+ comp * static_dofs_per_component) *
+ VectorizedArrayType::size());
}
}
}
{
const unsigned int ind = index_array[i];
for (unsigned int comp = 0; comp < n_components; ++comp)
- do_vectorized_add(
- temp1[i + 2 * comp * dofs_per_face],
- dst_ptr + dof_index +
- (ind + comp * static_dofs_per_component) *
- VectorizedArrayType::n_array_elements);
+ do_vectorized_add(temp1[i + 2 * comp * dofs_per_face],
+ dst_ptr + dof_index +
+ (ind +
+ comp * static_dofs_per_component) *
+ VectorizedArrayType::size());
}
}
}
{
AssertDimension(
dof_info.n_vectorization_lanes_filled[dof_access_index][cell],
- VectorizedArrayType::n_array_elements);
+ VectorizedArrayType::size());
const unsigned int *indices =
- &dof_info.dof_indices_contiguous
- [dof_access_index][cell * VectorizedArrayType::n_array_elements];
+ &dof_info
+ .dof_indices_contiguous[dof_access_index]
+ [cell * VectorizedArrayType::size()];
if (fe_degree > 1 && integrate_gradients == true)
{
// we know that the gradient weights for the Hermite case on the
for (unsigned int i = 0; i < dofs_per_face; ++i)
{
const unsigned int ind1 =
- index_array[2 * i] * VectorizedArrayType::n_array_elements;
+ index_array[2 * i] * VectorizedArrayType::size();
const unsigned int ind2 =
- index_array[2 * i + 1] *
- VectorizedArrayType::n_array_elements;
+ index_array[2 * i + 1] * VectorizedArrayType::size();
for (unsigned int comp = 0; comp < n_components; ++comp)
{
VectorizedArrayType val =
indices,
dst_ptr + ind1 +
comp * static_dofs_per_component *
- VectorizedArrayType::n_array_elements +
+ VectorizedArrayType::size() +
dof_info.component_dof_indices_offset
[active_fe_index][first_selected_component] *
- VectorizedArrayType::n_array_elements);
+ VectorizedArrayType::size());
do_vectorized_scatter_add(
grad,
indices,
dst_ptr + ind2 +
comp * static_dofs_per_component *
- VectorizedArrayType::n_array_elements +
+ VectorizedArrayType::size() +
dof_info.component_dof_indices_offset
[active_fe_index][first_selected_component] *
- VectorizedArrayType::n_array_elements);
+ VectorizedArrayType::size());
}
}
}
for (unsigned int i = 0; i < dofs_per_face; ++i)
{
const unsigned int ind =
- index_array[i] * VectorizedArrayType::n_array_elements;
+ index_array[i] * VectorizedArrayType::size();
for (unsigned int comp = 0; comp < n_components; ++comp)
do_vectorized_scatter_add(
temp1[i + 2 * comp * dofs_per_face],
indices,
dst_ptr + ind +
comp * static_dofs_per_component *
- VectorizedArrayType::n_array_elements +
+ VectorizedArrayType::size() +
dof_info.component_dof_indices_offset
[active_fe_index][first_selected_component] *
- VectorizedArrayType::n_array_elements);
+ VectorizedArrayType::size());
}
}
}
{
const unsigned int *strides =
&dof_info.dof_indices_interleave_strides
- [dof_access_index][cell * VectorizedArrayType::n_array_elements];
- unsigned int indices[VectorizedArrayType::n_array_elements];
- for (unsigned int v = 0; v < VectorizedArrayType::n_array_elements;
- ++v)
+ [dof_access_index][cell * VectorizedArrayType::size()];
+ unsigned int indices[VectorizedArrayType::size()];
+ for (unsigned int v = 0; v < VectorizedArrayType::size(); ++v)
indices[v] =
dof_info.dof_indices_contiguous
- [dof_access_index]
- [cell * VectorizedArrayType::n_array_elements + v] +
+ [dof_access_index][cell * VectorizedArrayType::size() + v] +
dof_info.component_dof_indices_offset[active_fe_index]
[first_selected_component] *
strides[v];
const unsigned int *index_array =
&data.face_to_cell_index_hermite(face_no, 0);
- if (nvec == VectorizedArrayType::n_array_elements)
+ if (nvec == VectorizedArrayType::size())
for (unsigned int comp = 0; comp < n_components; ++comp)
for (unsigned int i = 0; i < dofs_per_face; ++i)
{
- unsigned int ind1[VectorizedArrayType::n_array_elements];
+ unsigned int ind1[VectorizedArrayType::size()];
DEAL_II_OPENMP_SIMD_PRAGMA
- for (unsigned int v = 0;
- v < VectorizedArrayType::n_array_elements;
+ for (unsigned int v = 0; v < VectorizedArrayType::size();
++v)
ind1[v] =
indices[v] + (comp * static_dofs_per_component +
index_array[2 * i]) *
strides[v];
- unsigned int ind2[VectorizedArrayType::n_array_elements];
+ unsigned int ind2[VectorizedArrayType::size()];
DEAL_II_OPENMP_SIMD_PRAGMA
- for (unsigned int v = 0;
- v < VectorizedArrayType::n_array_elements;
+ for (unsigned int v = 0; v < VectorizedArrayType::size();
++v)
ind2[v] =
indices[v] + (comp * static_dofs_per_component +
dofs_per_face);
const unsigned int *index_array =
&data.face_to_cell_index_nodal(face_no, 0);
- if (nvec == VectorizedArrayType::n_array_elements)
+ if (nvec == VectorizedArrayType::size())
for (unsigned int comp = 0; comp < n_components; ++comp)
for (unsigned int i = 0; i < dofs_per_face; ++i)
{
- unsigned int ind[VectorizedArrayType::n_array_elements];
+ unsigned int ind[VectorizedArrayType::size()];
DEAL_II_OPENMP_SIMD_PRAGMA
- for (unsigned int v = 0;
- v < VectorizedArrayType::n_array_elements;
+ for (unsigned int v = 0; v < VectorizedArrayType::size();
++v)
ind[v] =
indices[v] +
internal::MatrixFreeFunctions::DoFInfo::IndexStorageVariants::
contiguous &&
dof_info.n_vectorization_lanes_filled[dof_access_index][cell] ==
- VectorizedArrayType::n_array_elements)
+ VectorizedArrayType::size())
{
const unsigned int *indices =
- &dof_info.dof_indices_contiguous
- [dof_access_index][cell * VectorizedArrayType::n_array_elements];
+ &dof_info
+ .dof_indices_contiguous[dof_access_index]
+ [cell * VectorizedArrayType::size()];
if (integrate_gradients == true &&
data.element_type ==
* on the given cell. This call is slower than the ones done through a
* MatrixFree object and lead to a structure that does not effectively use
* vectorization in the evaluate routines based on these values (instead,
- * VectorizedArray::n_array_elements same copies are worked on).
+ * VectorizedArray::size() same copies are worked on).
*
* If the given vector template class is a block vector (determined through
* the template function 'IsBlockVector<VectorType>::value', which checks
* on the given cell. This call is slower than the ones done through a
* MatrixFree object and lead to a structure that does not effectively use
* vectorization in the evaluate routines based on these values (instead,
- * VectorizedArray::n_array_elements same copies are worked on).
+ * VectorizedArray::size() same copies are worked on).
*
* If the given vector template class is a block vector (determined through
* the template function 'IsBlockVector<VectorType>::value', which checks
* on the given cell. This call is slower than the ones done through a
* MatrixFree object and lead to a structure that does not effectively use
* vectorization in the evaluate routines based on these values (instead,
- * VectorizedArray::n_array_elements same copies are worked on).
+ * VectorizedArray::size() same copies are worked on).
*
* If the given vector template class is a block vector (determined through
* the template function 'IsBlockVector<VectorType>::value', which checks
template <typename VectorType>
void
distribute_local_to_global(
- VectorType & dst,
- const unsigned int first_index = 0,
- const std::bitset<VectorizedArrayType::n_array_elements> &mask =
- std::bitset<VectorizedArrayType::n_array_elements>().flip()) const;
+ VectorType & dst,
+ const unsigned int first_index = 0,
+ const std::bitset<VectorizedArrayType::size()> &mask =
+ std::bitset<VectorizedArrayType::size()>().flip()) const;
/**
* Takes the values stored internally on dof values of the current cell and
* on the given cell. This call is slower than the ones done through a
* MatrixFree object and lead to a structure that does not effectively use
* vectorization in the evaluate routines based on these values (instead,
- * VectorizedArray::n_array_elements same copies are worked on).
+ * VectorizedArray::size() same copies are worked on).
*
* If the given vector template class is a block vector (determined through
* the template function 'IsBlockVector<VectorType>::value', which checks
*/
template <typename VectorType>
void
- set_dof_values(
- VectorType & dst,
- const unsigned int first_index = 0,
- const std::bitset<VectorizedArrayType::n_array_elements> &mask =
- std::bitset<VectorizedArrayType::n_array_elements>().flip()) const;
+ set_dof_values(VectorType & dst,
+ const unsigned int first_index = 0,
+ const std::bitset<VectorizedArrayType::size()> &mask =
+ std::bitset<VectorizedArrayType::size()>().flip()) const;
//@}
* arbitrary data type.
*/
template <typename T>
- std::array<T, VectorizedArrayType::n_array_elements>
- read_cell_data(
- const AlignedVector<std::array<T, VectorizedArrayType::n_array_elements>>
- &array) const;
+ std::array<T, VectorizedArrayType::size()>
+ read_cell_data(const AlignedVector<std::array<T, VectorizedArrayType::size()>>
+ &array) const;
/**
* Return the id of the cells this FEEvaluation or FEFaceEvaluation is
* associated with.
*/
- std::array<unsigned int, VectorizedArrayType::n_array_elements>
+ std::array<unsigned int, VectorizedArrayType::size()>
get_cell_ids() const;
//@}
*/
template <typename VectorType, typename VectorOperation>
void
- read_write_operation(
- const VectorOperation & operation,
- VectorType * vectors[],
- const std::bitset<VectorizedArrayType::n_array_elements> &mask,
- const bool apply_constraints = true) const;
+ read_write_operation(const VectorOperation &operation,
+ VectorType * vectors[],
+ const std::bitset<VectorizedArrayType::size()> &mask,
+ const bool apply_constraints = true) const;
/**
* A unified function to read from and write into vectors based on the given
template <typename VectorType, typename VectorOperation>
void
read_write_operation_contiguous(
- const VectorOperation & operation,
- VectorType * vectors[],
- const std::bitset<VectorizedArrayType::n_array_elements> &mask) const;
+ const VectorOperation & operation,
+ VectorType * vectors[],
+ const std::bitset<VectorizedArrayType::size()> &mask) const;
/**
* A unified function to read from and write into vectors based on the given
* phi.quadrature_point(q_index);
* // Need to evaluate function for each component in VectorizedArray
* VectorizedArray<double> f_value;
- * for (unsigned int v=0;
- * v<VectorizedArray<double>::n_array_elements;
- * ++v)
+ * for (unsigned int v=0; v<VectorizedArray<double>::size(); ++v)
* {
* Point<dim> p;
* for (unsigned int d=0; d<dim; ++d)
* {
* fe_eval.reinit(cell);
* for (unsigned int i=0; i<dofs_per_cell;
- * i += VectorizedArray<double>::n_array_elements)
+ * i += VectorizedArray<double>::size())
* {
* const unsigned int n_items =
- * i+VectorizedArray<double>::n_array_elements > dofs_per_cell ?
+ * i+VectorizedArray<double>::size() > dofs_per_cell ?
* (dofs_per_cell - i) :
- * VectorizedArray<double>::n_array_elements;
+ * VectorizedArray<double>::size();
*
* // Set n_items unit vectors
* for (unsigned int j=0; j<dofs_per_cell; ++j)
set_data_pointers();
Assert(matrix_info->mapping_initialized() == true, ExcNotInitialized());
AssertDimension(matrix_info->get_task_info().vectorization_length,
- VectorizedArrayType::n_array_elements);
+ VectorizedArrayType::size());
AssertDimension((is_face ? data->n_q_points_face : data->n_q_points),
n_quadrature_points);
AssertDimension(n_quadrature_points,
typename Number,
bool is_face,
typename VectorizedArrayType>
-std::array<unsigned int, VectorizedArrayType::n_array_elements>
+std::array<unsigned int, VectorizedArrayType::size()>
FEEvaluationBase<dim, n_components_, Number, is_face, VectorizedArrayType>::
get_cell_ids() const
{
- const unsigned int v_len = VectorizedArrayType::n_array_elements;
- std::array<unsigned int, VectorizedArrayType::n_array_elements> cells;
+ const unsigned int v_len = VectorizedArrayType::size();
+ std::array<unsigned int, v_len> cells;
// initialize array
for (unsigned int i = 0; i < v_len; ++i)
is_interior_face ?
&this->matrix_info->get_face_info(cell).cells_interior[0] :
&this->matrix_info->get_face_info(cell).cells_exterior[0];
- for (unsigned int i = 0; i < VectorizedArrayType::n_array_elements; ++i)
+ for (unsigned int i = 0; i < VectorizedArrayType::size(); ++i)
if (cells_[i] != numbers::invalid_unsigned_int)
cells[i] = cells_[i];
}
// 2) actually gather values
VectorizedArrayType out = make_vectorized_array<Number>(Number(1.));
- for (unsigned int i = 0; i < VectorizedArrayType::n_array_elements; ++i)
+ for (unsigned int i = 0; i < VectorizedArrayType::size(); ++i)
if (cells[i] != numbers::invalid_unsigned_int)
- out[i] = array[cells[i] / VectorizedArrayType::n_array_elements]
- [cells[i] % VectorizedArrayType::n_array_elements];
+ out[i] = array[cells[i] / VectorizedArrayType::size()]
+ [cells[i] % VectorizedArrayType::size()];
return out;
}
bool is_face,
typename VectorizedArrayType>
template <typename T>
-inline std::array<T, VectorizedArrayType::n_array_elements>
+inline std::array<T, VectorizedArrayType::size()>
FEEvaluationBase<dim, n_components_, Number, is_face, VectorizedArrayType>::
- read_cell_data(
- const AlignedVector<std::array<T, VectorizedArrayType::n_array_elements>>
- &array) const
+ read_cell_data(const AlignedVector<std::array<T, VectorizedArrayType::size()>>
+ &array) const
{
Assert(matrix_info != nullptr, ExcNotImplemented());
AssertDimension(array.size(),
const auto cells = this->get_cell_ids();
// 2) actually gather values
- std::array<T, VectorizedArrayType::n_array_elements> out;
- for (unsigned int i = 0; i < VectorizedArrayType::n_array_elements; ++i)
+ std::array<T, VectorizedArrayType::size()> out;
+ for (unsigned int i = 0; i < VectorizedArrayType::size(); ++i)
if (cells[i] != numbers::invalid_unsigned_int)
- out[i] = array[cells[i] / VectorizedArrayType::n_array_elements]
- [cells[i] % VectorizedArrayType::n_array_elements];
+ out[i] = array[cells[i] / VectorizedArrayType::size()]
+ [cells[i] % VectorizedArrayType::size()];
return out;
}
template <typename VectorType, typename VectorOperation>
inline void
FEEvaluationBase<dim, n_components_, Number, is_face, VectorizedArrayType>::
- read_write_operation(
- const VectorOperation & operation,
- VectorType * src[],
- const std::bitset<VectorizedArrayType::n_array_elements> &mask,
- const bool apply_constraints) const
+ read_write_operation(const VectorOperation &operation,
+ VectorType * src[],
+ const std::bitset<VectorizedArrayType::size()> &mask,
+ const bool apply_constraints) const
{
// Case 1: No MatrixFree object given, simple case because we do not need to
// process constraints and need not care about vectorization -> go to
// Case 3: standard operation with one index per degree of freedom -> go on
// here
- constexpr unsigned int n_vectorization =
- VectorizedArrayType::n_array_elements;
+ constexpr unsigned int n_vectorization = VectorizedArrayType::size();
Assert(mask.count() == n_vectorization,
ExcNotImplemented("Masking currently not implemented for "
"non-contiguous DoF storage"));
if (dof_access_index ==
internal::MatrixFreeFunctions::DoFInfo::dof_access_cell)
for (unsigned int v = 0; v < n_vectorization_actual; ++v)
- cells_copied[v] = cell * VectorizedArrayType::n_array_elements + v;
+ cells_copied[v] = cell * VectorizedArrayType::size() + v;
cells = dof_access_index ==
internal::MatrixFreeFunctions::DoFInfo::dof_access_cell ?
&cells_copied[0] :
inline void
FEEvaluationBase<dim, n_components_, Number, is_face, VectorizedArrayType>::
read_write_operation_contiguous(
- const VectorOperation & operation,
- VectorType * src[],
- const std::bitset<VectorizedArrayType::n_array_elements> &mask) const
+ const VectorOperation & operation,
+ VectorType * src[],
+ const std::bitset<VectorizedArrayType::size()> &mask) const
{
// This functions processes the functions read_dof_values,
// distribute_local_to_global, and set_dof_values with the same code for
if (dof_info->index_storage_variants[ind][cell] ==
internal::MatrixFreeFunctions::DoFInfo::IndexStorageVariants::
interleaved_contiguous &&
- n_lanes == VectorizedArrayType::n_array_elements)
+ n_lanes == VectorizedArrayType::size())
{
const unsigned int dof_index =
- dof_indices_cont[cell * VectorizedArrayType::n_array_elements] +
+ dof_indices_cont[cell * VectorizedArrayType::size()] +
dof_info->component_dof_indices_offset[active_fe_index]
[first_selected_component] *
- VectorizedArrayType::n_array_elements;
+ VectorizedArrayType::size();
if (n_components == 1 || n_fe_components == 1)
for (unsigned int comp = 0; comp < n_components; ++comp)
operation.process_dofs_vectorized(data->dofs_per_component_on_cell,
const unsigned int vectorization_populated =
dof_info->n_vectorization_lanes_filled[ind][this->cell];
- unsigned int dof_indices[VectorizedArrayType::n_array_elements];
+ unsigned int dof_indices[VectorizedArrayType::size()];
for (unsigned int v = 0; v < vectorization_populated; ++v)
dof_indices[v] =
- dof_indices_cont[cell * VectorizedArrayType::n_array_elements + v] +
+ dof_indices_cont[cell * VectorizedArrayType::size() + v] +
dof_info->component_dof_indices_offset[active_fe_index]
[first_selected_component] *
dof_info->dof_indices_interleave_strides
- [ind][cell * VectorizedArrayType::n_array_elements + v];
+ [ind][cell * VectorizedArrayType::size() + v];
for (unsigned int v = vectorization_populated;
- v < VectorizedArrayType::n_array_elements;
+ v < VectorizedArrayType::size();
++v)
dof_indices[v] = numbers::invalid_unsigned_int;
// In the case with contiguous cell indices, we know that there are no
// constraints and that the indices within each element are contiguous
- if (vectorization_populated == VectorizedArrayType::n_array_elements &&
- n_lanes == VectorizedArrayType::n_array_elements)
+ if (vectorization_populated == VectorizedArrayType::size() &&
+ n_lanes == VectorizedArrayType::size())
{
if (dof_info->index_storage_variants[ind][cell] ==
internal::MatrixFreeFunctions::DoFInfo::IndexStorageVariants::
for (unsigned int i = 0; i < data->dofs_per_component_on_cell; ++i)
{
for (unsigned int comp = 0; comp < n_components; ++comp)
- operation.process_dof_gather(
- dof_indices,
- *src[comp],
- i * VectorizedArrayType::n_array_elements,
- values_dofs[comp][i],
- vector_selector);
+ operation.process_dof_gather(dof_indices,
+ *src[comp],
+ i * VectorizedArrayType::size(),
+ values_dofs[comp][i],
+ vector_selector);
}
else
for (unsigned int comp = 0; comp < n_components; ++comp)
dof_indices,
*src[0],
(comp * data->dofs_per_component_on_cell + i) *
- VectorizedArrayType::n_array_elements,
+ VectorizedArrayType::size(),
values_dofs[comp][i],
vector_selector);
}
ExcNotImplemented());
const unsigned int *offsets =
&dof_info->dof_indices_interleave_strides
- [ind][VectorizedArrayType::n_array_elements * cell];
+ [ind][VectorizedArrayType::size() * cell];
if (n_components == 1 || n_fe_components == 1)
for (unsigned int i = 0; i < data->dofs_per_component_on_cell; ++i)
{
values_dofs[comp][i],
vector_selector);
DEAL_II_OPENMP_SIMD_PRAGMA
- for (unsigned int v = 0;
- v < VectorizedArrayType::n_array_elements;
- ++v)
+ for (unsigned int v = 0; v < VectorizedArrayType::size(); ++v)
dof_indices[v] += offsets[v];
}
else
values_dofs[comp][i],
vector_selector);
DEAL_II_OPENMP_SIMD_PRAGMA
- for (unsigned int v = 0;
- v < VectorizedArrayType::n_array_elements;
- ++v)
+ for (unsigned int v = 0; v < VectorizedArrayType::size(); ++v)
dof_indices[v] += offsets[v];
}
}
{
const unsigned int *offsets =
&dof_info->dof_indices_interleave_strides
- [ind][VectorizedArrayType::n_array_elements * cell];
+ [ind][VectorizedArrayType::size() * cell];
for (unsigned int v = 0; v < vectorization_populated; ++v)
- AssertIndexRange(offsets[v],
- VectorizedArrayType::n_array_elements + 1);
+ AssertIndexRange(offsets[v], VectorizedArrayType::size() + 1);
if (n_components == 1 || n_fe_components == 1)
for (unsigned int v = 0; v < vectorization_populated; ++v)
{
get_vector_component(const_cast<VectorType &>(src), d + first_index);
internal::VectorReader<Number, VectorizedArrayType> reader;
- read_write_operation(
- reader,
- src_data,
- std::bitset<VectorizedArrayType::n_array_elements>().flip(),
- true);
+ read_write_operation(reader,
+ src_data,
+ std::bitset<VectorizedArrayType::size()>().flip(),
+ true);
# ifdef DEBUG
dof_values_initialized = true;
get_vector_component(const_cast<VectorType &>(src), d + first_index);
internal::VectorReader<Number, VectorizedArrayType> reader;
- read_write_operation(
- reader,
- src_data,
- std::bitset<VectorizedArrayType::n_array_elements>().flip(),
- false);
+ read_write_operation(reader,
+ src_data,
+ std::bitset<VectorizedArrayType::size()>().flip(),
+ false);
# ifdef DEBUG
dof_values_initialized = true;
inline void
FEEvaluationBase<dim, n_components_, Number, is_face, VectorizedArrayType>::
distribute_local_to_global(
- VectorType & dst,
- const unsigned int first_index,
- const std::bitset<VectorizedArrayType::n_array_elements> &mask) const
+ VectorType & dst,
+ const unsigned int first_index,
+ const std::bitset<VectorizedArrayType::size()> &mask) const
{
# ifdef DEBUG
Assert(dof_values_initialized == true,
template <typename VectorType>
inline void
FEEvaluationBase<dim, n_components_, Number, is_face, VectorizedArrayType>::
- set_dof_values(
- VectorType & dst,
- const unsigned int first_index,
- const std::bitset<VectorizedArrayType::n_array_elements> &mask) const
+ set_dof_values(VectorType & dst,
+ const unsigned int first_index,
+ const std::bitset<VectorizedArrayType::size()> &mask) const
{
# ifdef DEBUG
Assert(dof_values_initialized == true,
input_vector.begin() +
this->dof_info->dof_indices_contiguous
[internal::MatrixFreeFunctions::DoFInfo::dof_access_cell]
- [this->cell * VectorizedArrayType::n_array_elements]) %
+ [this->cell * VectorizedArrayType::size()]) %
sizeof(VectorizedArrayType) ==
0)
{
input_vector.begin() +
this->dof_info->dof_indices_contiguous
[internal::MatrixFreeFunctions::DoFInfo::dof_access_cell]
- [this->cell * VectorizedArrayType::n_array_elements] +
+ [this->cell * VectorizedArrayType::size()] +
this->dof_info
->component_dof_indices_offset[this->active_fe_index]
[this->first_selected_component] *
- VectorizedArrayType::n_array_elements);
+ VectorizedArrayType::size());
evaluate(vec_values,
evaluate_values,
destination.begin() +
this->dof_info->dof_indices_contiguous
[internal::MatrixFreeFunctions::DoFInfo::dof_access_cell]
- [this->cell * VectorizedArrayType::n_array_elements]) %
+ [this->cell * VectorizedArrayType::size()]) %
sizeof(VectorizedArrayType) ==
0)
{
destination.begin() +
this->dof_info->dof_indices_contiguous
[internal::MatrixFreeFunctions::DoFInfo::dof_access_cell]
- [this->cell * VectorizedArrayType::n_array_elements] +
+ [this->cell * VectorizedArrayType::size()] +
this->dof_info
->component_dof_indices_offset[this->active_fe_index]
[this->first_selected_component] *
- VectorizedArrayType::n_array_elements);
+ VectorizedArrayType::size());
SelectEvaluator<dim,
fe_degree,
n_q_points_1d,
internal::MatrixFreeFunctions::DoFInfo::dof_access_face_interior :
internal::MatrixFreeFunctions::DoFInfo::dof_access_face_exterior;
Assert(this->mapping_data != nullptr, ExcNotInitialized());
- const unsigned int n_vectors = VectorizedArrayType::n_array_elements;
+ const unsigned int n_vectors = VectorizedArrayType::size();
const internal::MatrixFreeFunctions::FaceToCellTopology<n_vectors> &faces =
this->matrix_info->get_face_info(face_index);
if (face_index >=
initialize(
const dealii::Triangulation<dim> & tria,
const std::vector<std::pair<unsigned int, unsigned int>> &cells,
- const FaceInfo<VectorizedArrayType::n_array_elements> & faces,
+ const FaceInfo<VectorizedArrayType::size()> & faces,
const std::vector<unsigned int> & active_fe_index,
const Mapping<dim> & mapping,
const std::vector<dealii::hp::QCollection<1>> &quad,
update_mapping(
const dealii::Triangulation<dim> & tria,
const std::vector<std::pair<unsigned int, unsigned int>> &cells,
- const FaceInfo<VectorizedArrayType::n_array_elements> & faces,
+ const FaceInfo<VectorizedArrayType::size()> & faces,
const std::vector<unsigned int> &active_fe_index,
const Mapping<dim> & mapping);
initialize_faces(
const dealii::Triangulation<dim> & tria,
const std::vector<std::pair<unsigned int, unsigned int>> &cells,
- const std::vector<
- FaceToCellTopology<VectorizedArrayType::n_array_elements>> &faces,
- const Mapping<dim> & mapping);
+ const std::vector<FaceToCellTopology<VectorizedArrayType::size()>>
+ & faces,
+ const Mapping<dim> &mapping);
/**
* Computes the information in the given faces, called within
bool
operator()(
- const Tensor<1, VectorizedArrayType::n_array_elements, Number> &t1,
- const Tensor<1, VectorizedArrayType::n_array_elements, Number> &t2)
- const;
+ const Tensor<1, VectorizedArrayType::size(), Number> &t1,
+ const Tensor<1, VectorizedArrayType::size(), Number> &t2) const;
template <int dim>
bool
operator()(
- const Tensor<1,
- dim,
- Tensor<1, VectorizedArrayType::n_array_elements, Number>>
+ const Tensor<1, dim, Tensor<1, VectorizedArrayType::size(), Number>>
&t1,
- const Tensor<1,
- dim,
- Tensor<1, VectorizedArrayType::n_array_elements, Number>>
+ const Tensor<1, dim, Tensor<1, VectorizedArrayType::size(), Number>>
&t2) const;
template <int dim>
bool
operator()(
- const Tensor<2,
- dim,
- Tensor<1, VectorizedArrayType::n_array_elements, Number>>
+ const Tensor<2, dim, Tensor<1, VectorizedArrayType::size(), Number>>
&t1,
- const Tensor<2,
- dim,
- Tensor<1, VectorizedArrayType::n_array_elements, Number>>
+ const Tensor<2, dim, Tensor<1, VectorizedArrayType::size(), Number>>
&t2) const;
Number tolerance;
MappingInfo<dim, Number, VectorizedArrayType>::initialize(
const dealii::Triangulation<dim> & tria,
const std::vector<std::pair<unsigned int, unsigned int>> &cells,
- const FaceInfo<VectorizedArrayType::n_array_elements> & face_info,
+ const FaceInfo<VectorizedArrayType::size()> & face_info,
const std::vector<unsigned int> & active_fe_index,
const Mapping<dim> & mapping,
const std::vector<dealii::hp::QCollection<1>> & quad,
MappingInfo<dim, Number, VectorizedArrayType>::update_mapping(
const dealii::Triangulation<dim> & tria,
const std::vector<std::pair<unsigned int, unsigned int>> &cells,
- const FaceInfo<VectorizedArrayType::n_array_elements> & face_info,
+ const FaceInfo<VectorizedArrayType::size()> & face_info,
const std::vector<unsigned int> & active_fe_index,
const Mapping<dim> & mapping)
{
- AssertDimension(cells.size() / VectorizedArrayType::n_array_elements,
+ AssertDimension(cells.size() / VectorizedArrayType::size(),
cell_type.size());
for (auto &data : cell_data)
: data(FPArrayComparator<Number, VectorizedArrayType>(expected_size))
{}
- std::map<
- Tensor<2,
- dim,
- Tensor<1, VectorizedArrayType::n_array_elements, Number>>,
- unsigned int,
- FPArrayComparator<Number, VectorizedArrayType>>
+ std::map<Tensor<2, dim, Tensor<1, VectorizedArrayType::size(), Number>>,
+ unsigned int,
+ FPArrayComparator<Number, VectorizedArrayType>>
data;
};
*/
template <int dim, typename Number, typename VectorizedArrayType>
void
- evaluate_on_cell(
- const dealii::Triangulation<dim> & tria,
- const std::pair<unsigned int, unsigned int> *cells,
- const unsigned int my_q,
- GeometryType & cell_t_prev,
- GeometryType (&cell_t)[VectorizedArrayType::n_array_elements],
- dealii::FEValues<dim, dim> & fe_val,
- LocalData<dim, Number, VectorizedArrayType> &cell_data)
+ evaluate_on_cell(const dealii::Triangulation<dim> & tria,
+ const std::pair<unsigned int, unsigned int> *cells,
+ const unsigned int my_q,
+ GeometryType & cell_t_prev,
+ GeometryType (&cell_t)[VectorizedArrayType::size()],
+ dealii::FEValues<dim, dim> & fe_val,
+ LocalData<dim, Number, VectorizedArrayType> &cell_data)
{
const unsigned int n_q_points = fe_val.n_quadrature_points;
const UpdateFlags update_flags = fe_val.get_update_flags();
// not have that field here)
const double zero_tolerance_double =
cell_data.jac_size * std::numeric_limits<double>::epsilon() * 1024.;
- for (unsigned int j = 0; j < VectorizedArrayType::n_array_elements; ++j)
+ for (unsigned int j = 0; j < VectorizedArrayType::size(); ++j)
{
typename dealii::Triangulation<dim>::cell_iterator cell_it(
&tria, cells[j].first, cells[j].second);
jacobian_grad[d][e][f];
}
}
- } // end loop over entries of vectorization (n_array_elements cells)
+ } // end loop over entries of vectorization (size() cells)
// set information for next cell
- cell_t_prev = cell_t[VectorizedArrayType::n_array_elements - 1];
+ cell_t_prev = cell_t[VectorizedArrayType::size() - 1];
}
// encodes the cell types of the current cell. Since several cells
// must be considered together, this variable holds the individual
// info of the last chunk of cells
- GeometryType cell_t[VectorizedArrayType::n_array_elements];
+ GeometryType cell_t[VectorizedArrayType::size()];
GeometryType cell_t_prev = general;
// fe_values object that is used to compute the mapping data. for
evaluate_on_cell<dim, Number, VectorizedArrayType>(
tria,
- &cells[cell * VectorizedArrayType::n_array_elements],
+ &cells[cell * VectorizedArrayType::size()],
my_q,
cell_t_prev,
cell_t,
// find the most general cell type (most general type is 3
// (general cell))
GeometryType most_general_type = cartesian;
- for (unsigned int j = 0;
- j < VectorizedArrayType::n_array_elements;
- ++j)
+ for (unsigned int j = 0; j < VectorizedArrayType::size(); ++j)
if (cell_t[j] > most_general_type)
most_general_type = cell_t[j];
AssertIndexRange(most_general_type, 4U);
std::pair<
Tensor<2,
dim,
- Tensor<1,
- VectorizedArrayType::n_array_elements,
- Number>>,
+ Tensor<1, VectorizedArrayType::size(), Number>>,
unsigned int>
new_entry;
// This number overlaps with the general data but we
for (unsigned int d = 0; d < dim; ++d)
for (unsigned int e = 0; e < dim; ++e)
for (unsigned int v = 0;
- v < VectorizedArrayType::n_array_elements;
+ v < VectorizedArrayType::size();
++v)
new_entry.first[d][e][v] =
cell_data.const_jac[d][e][v];
cell_data.general_jac[q];
Tensor<3, dim, VectorizedArrayType> &jacobian_grad =
cell_data.general_jac_grad[q];
- for (unsigned int j = 0;
- j < VectorizedArrayType::n_array_elements;
+ for (unsigned int j = 0; j < VectorizedArrayType::size();
++j)
if (cell_t[j] < general)
{
const std::vector<unsigned int> & active_fe_index,
const Mapping<dim> & mapping)
{
- const unsigned int n_cells = cells.size();
- const unsigned int vectorization_width =
- VectorizedArrayType::n_array_elements;
+ const unsigned int n_cells = cells.size();
+ const unsigned int vectorization_width = VectorizedArrayType::size();
Assert(n_cells % vectorization_width == 0, ExcInternalError());
const unsigned int n_macro_cells = n_cells / vectorization_width;
cell_type.resize(n_macro_cells);
Tensor<2, dim, VectorizedArrayType> jac;
for (unsigned int d = 0; d < dim; ++d)
for (unsigned int e = 0; e < dim; ++e)
- for (unsigned int v = 0;
- v < VectorizedArrayType::n_array_elements;
+ for (unsigned int v = 0; v < VectorizedArrayType::size();
++v)
jac[d][e][v] = it.first[d][e][v];
AssertIndexRange(it.second, n_constant_jacobians);
// (inner tensor). We cannot choose a VectorizedArray type directly
// because std::map does not provide the necessary alignment upon
// memory allocation.
- std::map<
- Tensor<1,
- 2 * dim * dim + dim + 1,
- Tensor<1, VectorizedArrayType::n_array_elements, Number>>,
- unsigned int,
- FPArrayComparator<Number, VectorizedArrayType>>
+ std::map<Tensor<1,
+ 2 * dim * dim + dim + 1,
+ Tensor<1, VectorizedArrayType::size(), Number>>,
+ unsigned int,
+ FPArrayComparator<Number, VectorizedArrayType>>
data;
// Store the scaling factor
const std::pair<unsigned int, unsigned int> face_range,
const dealii::Triangulation<dim> & tria,
const std::vector<std::pair<unsigned int, unsigned int>> &cells,
- const std::vector<
- FaceToCellTopology<VectorizedArrayType::n_array_elements>> &faces,
- const Mapping<dim> & mapping,
+ const std::vector<FaceToCellTopology<VectorizedArrayType::size()>>
+ & faces,
+ const Mapping<dim> & mapping,
MappingInfo<dim, Number, VectorizedArrayType> &mapping_info,
std::pair<
std::vector<
bool normal_is_similar = true;
bool JxW_is_similar = true;
bool cell_is_cartesian = true;
- for (unsigned int v = 0;
- v < VectorizedArrayType::n_array_elements;
- ++v)
+ for (unsigned int v = 0; v < VectorizedArrayType::size(); ++v)
{
Tensor<2, dim> jacobian_0;
double compare_norm_jac = 1.;
face_data.quadrature_points[q]);
}
- using VEC_ARRAY =
- Tensor<1, VectorizedArrayType::n_array_elements, Number>;
+ using VEC_ARRAY = Tensor<1, VectorizedArrayType::size(), Number>;
unsigned int insert_position = data.first[my_q].JxW_values.size();
// Fill in JxW values, apply compression
unsigned int>
new_entry;
new_entry.second = data.second.data.size();
- for (unsigned int v = 0;
- v < VectorizedArrayType::n_array_elements;
+ for (unsigned int v = 0; v < VectorizedArrayType::size();
++v)
new_entry.first[2 * dim * dim + dim][v] =
face_data.JxW_values[0][v] / quadrature.weight(0) /
for (unsigned int d = 0; d < dim; ++d)
for (unsigned int e = 0; e < dim; ++e)
for (unsigned int v = 0;
- v < VectorizedArrayType::n_array_elements;
+ v < VectorizedArrayType::size();
++v)
new_entry.first[d * dim + e][v] =
face_data.general_jac[0][d][e][v];
for (unsigned int d = 0; d < dim; ++d)
for (unsigned int e = 0; e < dim; ++e)
for (unsigned int v = 0;
- v < VectorizedArrayType::n_array_elements;
+ v < VectorizedArrayType::size();
++v)
new_entry.first[dim * dim + d * dim + e][v] =
face_data.general_jac[n_q_points][d][e][v];
// size to get the right scaling
for (unsigned int d = 0; d < dim; ++d)
for (unsigned int v = 0;
- v < VectorizedArrayType::n_array_elements;
+ v < VectorizedArrayType::size();
++v)
new_entry.first[2 * dim * dim + d][v] =
face_data.normal_vectors[0][d][v] /
const unsigned int first_face,
const unsigned int last_face,
const std::vector<GeometryType> &face_type,
- const std::vector<
- FaceToCellTopology<VectorizedArrayType::n_array_elements>> &faces,
+ const std::vector<FaceToCellTopology<VectorizedArrayType::size()>>
+ &faces,
MappingInfoStorage<dim - 1, dim, Number, VectorizedArrayType>
&data_faces)
{
template <int dim, typename Number, typename VectorizedArrayType>
void
MappingInfo<dim, Number, VectorizedArrayType>::initialize_faces(
- const dealii::Triangulation<dim> & tria,
- const std::vector<std::pair<unsigned int, unsigned int>> &cells,
- const std::vector<
- FaceToCellTopology<VectorizedArrayType::n_array_elements>> &faces,
- const Mapping<dim> & mapping)
+ const dealii::Triangulation<dim> & tria,
+ const std::vector<std::pair<unsigned int, unsigned int>> & cells,
+ const std::vector<FaceToCellTopology<VectorizedArrayType::size()>> &faces,
+ const Mapping<dim> &mapping)
{
face_type.resize(faces.size(), general);
for (const auto &it : data_faces_local[0].second.data)
{
// JxW values; invert previously applied scaling
- for (unsigned int v = 0;
- v < VectorizedArrayType::n_array_elements;
- ++v)
+ for (unsigned int v = 0; v < VectorizedArrayType::size(); ++v)
face_data[my_q].JxW_values[it.second][v] =
it.first[2 * dim * dim + dim][v] *
Utilities::fixed_power<dim>(jac_size);
for (unsigned int d = 0; d < dim; ++d)
for (unsigned int e = 0; e < dim; ++e)
for (unsigned int v = 0;
- v < VectorizedArrayType::n_array_elements;
+ v < VectorizedArrayType::size();
++v)
face_data[my_q].jacobians[i][it.second][d][e][v] =
it.first[i * dim * dim + d * dim + e][v];
// normal vectors; invert previously applied scaling
for (unsigned int d = 0; d < dim; ++d)
- for (unsigned int v = 0;
- v < VectorizedArrayType::n_array_elements;
+ for (unsigned int v = 0; v < VectorizedArrayType::size();
++v)
face_data[my_q].normal_vectors[it.second][d][v] =
it.first[2 * dim * dim + d][v] * jac_size;
if (update_flags_faces_by_cells == update_default)
return;
- const unsigned int n_quads = face_data_by_cells.size();
- const unsigned int vectorization_width =
- VectorizedArrayType::n_array_elements;
- UpdateFlags update_flags =
+ const unsigned int n_quads = face_data_by_cells.size();
+ const unsigned int vectorization_width = VectorizedArrayType::size();
+ UpdateFlags update_flags =
(update_flags_faces_by_cells & update_quadrature_points ?
update_quadrature_points :
update_default) |
template <typename Number, typename VectorizedArrayType>
bool
- FPArrayComparator<Number, VectorizedArrayType>::operator()(
- const Tensor<1, VectorizedArrayType::n_array_elements, Number> &t1,
- const Tensor<1, VectorizedArrayType::n_array_elements, Number> &t2) const
+ FPArrayComparator<Number, VectorizedArrayType>::
+ operator()(const Tensor<1, VectorizedArrayType::size(), Number> &t1,
+ const Tensor<1, VectorizedArrayType::size(), Number> &t2) const
{
- for (unsigned int k = 0; k < VectorizedArrayType::n_array_elements; ++k)
+ for (unsigned int k = 0; k < VectorizedArrayType::size(); ++k)
if (t1[k] < t2[k] - tolerance)
return true;
else if (t1[k] > t2[k] + tolerance)
template <int dim>
bool
FPArrayComparator<Number, VectorizedArrayType>::operator()(
- const Tensor<1,
- dim,
- Tensor<1, VectorizedArrayType::n_array_elements, Number>>
- &t1,
- const Tensor<1,
- dim,
- Tensor<1, VectorizedArrayType::n_array_elements, Number>>
- &t2) const
+ const Tensor<1, dim, Tensor<1, VectorizedArrayType::size(), Number>> &t1,
+ const Tensor<1, dim, Tensor<1, VectorizedArrayType::size(), Number>> &t2)
+ const
{
for (unsigned int d = 0; d < dim; ++d)
- for (unsigned int k = 0; k < VectorizedArrayType::n_array_elements; ++k)
+ for (unsigned int k = 0; k < VectorizedArrayType::size(); ++k)
if (t1[d][k] < t2[d][k] - tolerance)
return true;
else if (t1[d][k] > t2[d][k] + tolerance)
template <int dim>
bool
FPArrayComparator<Number, VectorizedArrayType>::operator()(
- const Tensor<2,
- dim,
- Tensor<1, VectorizedArrayType::n_array_elements, Number>>
- &t1,
- const Tensor<2,
- dim,
- Tensor<1, VectorizedArrayType::n_array_elements, Number>>
- &t2) const
+ const Tensor<2, dim, Tensor<1, VectorizedArrayType::size(), Number>> &t1,
+ const Tensor<2, dim, Tensor<1, VectorizedArrayType::size(), Number>> &t2)
+ const
{
for (unsigned int d = 0; d < dim; ++d)
for (unsigned int e = 0; e < dim; ++e)
- for (unsigned int k = 0; k < VectorizedArrayType::n_array_elements;
- ++k)
+ for (unsigned int k = 0; k < VectorizedArrayType::size(); ++k)
if (t1[d][e][k] < t2[d][e][k] - tolerance)
return true;
else if (t1[d][e][k] > t2[d][e][k] + tolerance)
* general. The cell range in @p cell_loop runs from zero to n_cell_batches()
* (exclusive), so this is the appropriate size if you want to store arrays
* of data for all cells to be worked on. This number is approximately
- * `n_physical_cells()/VectorizedArray::n_array_elements` (depending on how
+ * `n_physical_cells()/VectorizedArray::size()` (depending on how
* many cell chunks that do not get filled up completely).
*/
unsigned int
* general. The cell range in @p cell_loop runs from zero to
* n_cell_batches() (exclusive), so this is the appropriate size if you want
* to store arrays of data for all cells to be worked on. This number is
- * approximately `n_physical_cells()/VectorizedArray::n_array_elements`
+ * approximately `n_physical_cells()/VectorizedArray::size()`
* (depending on how many cell chunks that do not get filled up completely).
*/
unsigned int
* Return the boundary ids for the faces within a cell, using the cells'
* sorting by lanes in the VectorizedArray.
*/
- std::array<types::boundary_id, VectorizedArrayType::n_array_elements>
+ std::array<types::boundary_id, VectorizedArrayType::size()>
get_faces_by_cells_boundary_id(const unsigned int macro_cell,
const unsigned int face_number) const;
* Return the connectivity information of a face.
*/
const internal::MatrixFreeFunctions::FaceToCellTopology<
- VectorizedArrayType::n_array_elements> &
+ VectorizedArrayType::size()> &
get_face_info(const unsigned int face_batch_number) const;
* Vector holding face information. Only initialized if
* build_face_info=true.
*/
- internal::MatrixFreeFunctions::FaceInfo<VectorizedArrayType::n_array_elements>
+ internal::MatrixFreeFunctions::FaceInfo<VectorizedArrayType::size()>
face_info;
/**
template <int dim, typename Number, typename VectorizedArrayType>
-inline std::array<types::boundary_id, VectorizedArrayType::n_array_elements>
+inline std::array<types::boundary_id, VectorizedArrayType::size()>
MatrixFree<dim, Number, VectorizedArrayType>::get_faces_by_cells_boundary_id(
const unsigned int macro_cell,
const unsigned int face_number) const
AssertIndexRange(face_number, GeometryInfo<dim>::faces_per_cell);
Assert(face_info.cell_and_face_boundary_id.size(0) >= n_macro_cells(),
ExcNotInitialized());
- std::array<types::boundary_id, VectorizedArrayType::n_array_elements> result;
+ std::array<types::boundary_id, VectorizedArrayType::size()> result;
result.fill(numbers::invalid_boundary_id);
for (unsigned int v = 0; v < n_active_entries_per_cell_batch(macro_cell); ++v)
result[v] = face_info.cell_and_face_boundary_id(macro_cell, face_number, v);
const unsigned int macro_cell) const
{
AssertIndexRange(macro_cell, task_info.cell_partition_data.back());
- return VectorizedArrayType::n_array_elements > 1 &&
- cell_level_index[(macro_cell + 1) *
- VectorizedArrayType::n_array_elements -
- 1] ==
- cell_level_index[(macro_cell + 1) *
- VectorizedArrayType::n_array_elements -
- 2];
+ return VectorizedArrayType::size() > 1 &&
+ cell_level_index[(macro_cell + 1) * VectorizedArrayType::size() - 1] ==
+ cell_level_index[(macro_cell + 1) * VectorizedArrayType::size() - 2];
}
const unsigned int cell_batch_number) const
{
AssertIndexRange(cell_batch_number, task_info.cell_partition_data.back());
- unsigned int n_components = VectorizedArrayType::n_array_elements;
- while (
- n_components > 1 &&
- cell_level_index[cell_batch_number * VectorizedArrayType::n_array_elements +
- n_components - 1] ==
- cell_level_index[cell_batch_number *
- VectorizedArrayType::n_array_elements +
- n_components - 2])
+ unsigned int n_components = VectorizedArrayType::size();
+ while (n_components > 1 &&
+ cell_level_index[cell_batch_number * VectorizedArrayType::size() +
+ n_components - 1] ==
+ cell_level_index[cell_batch_number * VectorizedArrayType::size() +
+ n_components - 2])
--n_components;
- AssertIndexRange(n_components - 1, VectorizedArrayType::n_array_elements);
+ AssertIndexRange(n_components - 1, VectorizedArrayType::size());
return n_components;
}
const unsigned int face_batch_number) const
{
AssertIndexRange(face_batch_number, face_info.faces.size());
- unsigned int n_components = VectorizedArrayType::n_array_elements;
+ unsigned int n_components = VectorizedArrayType::size();
while (n_components > 1 &&
face_info.faces[face_batch_number].cells_interior[n_components - 1] ==
numbers::invalid_unsigned_int)
--n_components;
- AssertIndexRange(n_components - 1, VectorizedArrayType::n_array_elements);
+ AssertIndexRange(n_components - 1, VectorizedArrayType::size());
return n_components;
}
template <int dim, typename Number, typename VectorizedArrayType>
inline const internal::MatrixFreeFunctions::FaceToCellTopology<
- VectorizedArrayType::n_array_elements> &
+ VectorizedArrayType::size()> &
MatrixFree<dim, Number, VectorizedArrayType>::get_face_info(
const unsigned int macro_face) const
{
return std::make_pair(0U, 0U);
std::pair<unsigned int, unsigned int> result;
- for (unsigned int v = 0; v < VectorizedArrayType::n_array_elements &&
+ for (unsigned int v = 0; v < VectorizedArrayType::size() &&
face_info.faces[macro_face].cells_interior[v] !=
numbers::invalid_unsigned_int;
++v)
.cell_active_fe_index[face_info.faces[macro_face].cells_interior[v]]);
if (face_info.faces[macro_face].cells_exterior[0] !=
numbers::invalid_unsigned_int)
- for (unsigned int v = 0; v < VectorizedArrayType::n_array_elements &&
+ for (unsigned int v = 0; v < VectorizedArrayType::size() &&
face_info.faces[macro_face].cells_exterior[v] !=
numbers::invalid_unsigned_int;
++v)
const unsigned int vector_number,
const unsigned int dof_handler_index) const
{
- const unsigned int vectorization_length =
- VectorizedArrayType::n_array_elements;
+ const unsigned int vectorization_length = VectorizedArrayType::size();
AssertIndexRange(dof_handler_index, dof_handlers.n_dof_handlers);
AssertIndexRange(macro_cell_number, task_info.cell_partition_data.back());
AssertIndexRange(vector_number, n_components_filled(macro_cell_number));
const unsigned int macro_cell_number,
const unsigned int vector_number) const
{
- const unsigned int vectorization_length =
- VectorizedArrayType::n_array_elements;
+ const unsigned int vectorization_length = VectorizedArrayType::size();
AssertIndexRange(macro_cell_number, task_info.cell_partition_data.back());
AssertIndexRange(vector_number, n_components_filled(macro_cell_number));
}
const internal::MatrixFreeFunctions::FaceToCellTopology<
- VectorizedArrayType::n_array_elements>
+ VectorizedArrayType::size()>
face2cell_info = get_face_info(face_batch_number);
const unsigned int cell_index =
const unsigned int vector_number,
const unsigned int dof_handler_index) const
{
- constexpr unsigned int vectorization_length =
- VectorizedArrayType::n_array_elements;
+ constexpr unsigned int vectorization_length = VectorizedArrayType::size();
AssertIndexRange(dof_handler_index, dof_handlers.n_dof_handlers);
AssertIndexRange(macro_cell_number, task_info.cell_partition_data.back());
AssertIndexRange(vector_number, n_components_filled(macro_cell_number));
std::vector<unsigned char> dummy2;
task_info.collect_boundary_cells(cell_level_index.size(),
cell_level_index.size(),
- VectorizedArrayType::n_array_elements,
+ VectorizedArrayType::size(),
dummy);
task_info.create_blocks_serial(
dummy, dummy, 1, dummy, false, dummy, dummy2);
// if indices are not initialized, the cell_level_index might not be
// divisible by the vectorization length. But it must be for
// mapping_info...
- while (cell_level_index.size() %
- VectorizedArrayType::n_array_elements !=
- 0)
+ while (cell_level_index.size() % VectorizedArrayType::size() != 0)
cell_level_index.push_back(cell_level_index.back());
}
}
std::vector<unsigned char> dummy2;
task_info.collect_boundary_cells(cell_level_index.size(),
cell_level_index.size(),
- VectorizedArrayType::n_array_elements,
+ VectorizedArrayType::size(),
dummy);
task_info.create_blocks_serial(
dummy, dummy, 1, dummy, false, dummy, dummy2);
// if indices are not initialized, the cell_level_index might not be
// divisible by the vectorization length. But it must be for
// mapping_info...
- while (cell_level_index.size() %
- VectorizedArrayType::n_array_elements !=
- 0)
+ while (cell_level_index.size() % VectorizedArrayType::size() != 0)
cell_level_index.push_back(cell_level_index.back());
}
}
dof_info.resize(dof_handlers.n_dof_handlers);
for (unsigned int no = 0; no < dof_handlers.n_dof_handlers; ++no)
- dof_info[no].vectorization_length = VectorizedArrayType::n_array_elements;
+ dof_info[no].vectorization_length = VectorizedArrayType::size();
// Go through cells on zeroth level and then successively step down into
// children. This gives a z-ordering of the cells, which is beneficial when
dof_info.resize(dof_handlers.n_dof_handlers);
for (unsigned int no = 0; no < dof_handlers.n_dof_handlers; ++no)
- dof_info[no].vectorization_length = VectorizedArrayType::n_array_elements;
+ dof_info[no].vectorization_length = VectorizedArrayType::size();
// go through cells on zeroth level and then successively step down into
// children. This gives a z-ordering of the cells, which is beneficial when
subdomain_boundary_cells.push_back(counter);
}
- const unsigned int vectorization_length =
- VectorizedArrayType::n_array_elements;
+ const unsigned int vectorization_length = VectorizedArrayType::size();
task_info.collect_boundary_cells(cell_level_index_end_local,
n_active_cells,
vectorization_length,
cell_level_index.resize(
cell_level_index.size() +
- VectorizedArrayType::n_array_elements *
+ VectorizedArrayType::size() *
(task_info.refinement_edge_face_partition_data[1] -
task_info.refinement_edge_face_partition_data[0]));
face_info.cell_and_face_to_plain_faces.reinit(
TableIndices<3>(task_info.cell_partition_data.back(),
GeometryInfo<dim>::faces_per_cell,
- VectorizedArrayType::n_array_elements),
+ VectorizedArrayType::size()),
true);
face_info.cell_and_face_to_plain_faces.fill(
numbers::invalid_unsigned_int);
face_info.cell_and_face_boundary_id.reinit(
TableIndices<3>(task_info.cell_partition_data.back(),
GeometryInfo<dim>::faces_per_cell,
- VectorizedArrayType::n_array_elements),
+ VectorizedArrayType::size()),
true);
face_info.cell_and_face_boundary_id.fill(numbers::invalid_boundary_id);
for (unsigned int f = 0; f < task_info.ghost_face_partition_data.back();
++f)
- for (unsigned int v = 0; v < VectorizedArrayType::n_array_elements &&
+ for (unsigned int v = 0; v < VectorizedArrayType::size() &&
face_info.faces[f].cells_interior[v] !=
numbers::invalid_unsigned_int;
++v)
{
TableIndices<3> index(face_info.faces[f].cells_interior[v] /
- VectorizedArrayType::n_array_elements,
+ VectorizedArrayType::size(),
face_info.faces[f].interior_face_no,
face_info.faces[f].cells_interior[v] %
- VectorizedArrayType::n_array_elements);
+ VectorizedArrayType::size());
// Assert(cell_and_face_to_plain_faces(index) ==
// numbers::invalid_unsigned_int,
// ExcInternalError("Should only visit each face once"));
face_info.cell_and_face_to_plain_faces(index) =
- f * VectorizedArrayType::n_array_elements + v;
+ f * VectorizedArrayType::size() + v;
if (face_info.faces[f].cells_exterior[v] !=
numbers::invalid_unsigned_int)
{
TableIndices<3> index(face_info.faces[f].cells_exterior[v] /
- VectorizedArrayType::n_array_elements,
+ VectorizedArrayType::size(),
face_info.faces[f].exterior_face_no,
face_info.faces[f].cells_exterior[v] %
- VectorizedArrayType::n_array_elements);
+ VectorizedArrayType::size());
// Assert(cell_and_face_to_plain_faces(index) ==
// numbers::invalid_unsigned_int,
// ExcInternalError("Should only visit each face once"));
face_info.cell_and_face_to_plain_faces(index) =
- f * VectorizedArrayType::n_array_elements + v;
+ f * VectorizedArrayType::size() + v;
}
else
face_info.cell_and_face_boundary_id(index) =
std::vector<types::global_dof_index> ghost_indices;
{
for (unsigned int cell = 0;
- cell <
- VectorizedArrayType::n_array_elements * n_macro_cells_before;
+ cell < VectorizedArrayType::size() * n_macro_cells_before;
++cell)
if (cell == 0 ||
cell_level_index[cell] != cell_level_index[cell - 1])
const bool,
const bool)> &fu) {
for (unsigned int f = 0; f < n_inner_face_batches(); ++f)
- for (unsigned int v = 0;
- v < VectorizedArrayType::n_array_elements &&
- face_info.faces[f].cells_interior[v] !=
- numbers::invalid_unsigned_int;
+ for (unsigned int v = 0; v < VectorizedArrayType::size() &&
+ face_info.faces[f].cells_interior[v] !=
+ numbers::invalid_unsigned_int;
++v)
{
AssertIndexRange(face_info.faces[f].cells_interior[v],
n_macro_cells_before *
- VectorizedArrayType::n_array_elements);
+ VectorizedArrayType::size());
const unsigned int p = face_info.faces[f].cells_exterior[v];
const unsigned int face_no =
face_info.faces[f].exterior_face_no;
const bool)> &fu) {
for (unsigned int c = 0; c < n_cell_batches(); ++c)
for (const unsigned int d : GeometryInfo<dim>::face_indices())
- for (unsigned int v = 0;
- v < VectorizedArrayType::n_array_elements;
- ++v)
+ for (unsigned int v = 0; v < VectorizedArrayType::size(); ++v)
{
unsigned int f =
this->face_info.cell_and_face_to_plain_faces(c, d, v);
if (f == numbers::invalid_unsigned_int)
continue;
- const unsigned int v_len =
- VectorizedArrayType::n_array_elements;
+ const unsigned int v_len = VectorizedArrayType::size();
const unsigned int cell_this = c * v_len + v;
const unsigned int cell_m = this->get_face_info(f / v_len)
// using AssertIndexRange, but that leads to an
// internal compiler error with GCC 7.4. Do things
// by hand instead.
- Assert(
- face_info.faces[f].cells_interior[v] <
- n_macro_cells_before *
- VectorizedArrayType::n_array_elements,
- ExcIndexRange(face_info.faces[f].cells_interior[v],
- 0,
- n_macro_cells_before *
- VectorizedArrayType::n_array_elements));
+ Assert(face_info.faces[f].cells_interior[v] <
+ n_macro_cells_before * VectorizedArrayType::size(),
+ ExcIndexRange(face_info.faces[f].cells_interior[v],
+ 0,
+ n_macro_cells_before *
+ VectorizedArrayType::size()));
if (flag ||
(di.index_storage_variants
[ext ? internal::MatrixFreeFunctions::DoFInfo::
bool
non_negative(const VectorizedArrayType &n)
{
- for (unsigned int v = 0; v < VectorizedArrayType::n_array_elements; ++v)
+ for (unsigned int v = 0; v < VectorizedArrayType::size(); ++v)
if (n[v] < 0.)
return false;
{
const Number *vec_ptr = vec.begin() + dof_index;
for (unsigned int i = 0; i < dofs_per_cell;
- ++i, vec_ptr += VectorizedArrayType::n_array_elements)
+ ++i, vec_ptr += VectorizedArrayType::size())
dof_values[i].load(vec_ptr);
}
std::integral_constant<bool, false>) const
{
for (unsigned int i = 0; i < dofs_per_cell; ++i)
- for (unsigned int v = 0; v < VectorizedArrayType::n_array_elements; ++v)
- dof_values[i][v] = vector_access(
- vec, dof_index + v + i * VectorizedArrayType::n_array_elements);
+ for (unsigned int v = 0; v < VectorizedArrayType::size(); ++v)
+ dof_values[i][v] =
+ vector_access(vec, dof_index + v + i * VectorizedArrayType::size());
}
std::integral_constant<bool, false>) const
{
for (unsigned int d = 0; d < dofs_per_cell; ++d)
- for (unsigned int v = 0; v < VectorizedArrayType::n_array_elements; ++v)
+ for (unsigned int v = 0; v < VectorizedArrayType::size(); ++v)
dof_values[d][v] = vector_access(vec, dof_indices[v] + d);
}
VectorizedArrayType &res,
std::integral_constant<bool, false>) const
{
- for (unsigned int v = 0; v < VectorizedArrayType::n_array_elements; ++v)
+ for (unsigned int v = 0; v < VectorizedArrayType::size(); ++v)
res[v] = vector_access(vec, indices[v] + constant_offset);
}
{
Number *vec_ptr = vec.begin() + dof_index;
for (unsigned int i = 0; i < dofs_per_cell;
- ++i, vec_ptr += VectorizedArrayType::n_array_elements)
+ ++i, vec_ptr += VectorizedArrayType::size())
{
VectorizedArrayType tmp;
tmp.load(vec_ptr);
std::integral_constant<bool, false>) const
{
for (unsigned int i = 0; i < dofs_per_cell; ++i)
- for (unsigned int v = 0; v < VectorizedArrayType::n_array_elements; ++v)
+ for (unsigned int v = 0; v < VectorizedArrayType::size(); ++v)
vector_access_add(vec,
- dof_index + v +
- i * VectorizedArrayType::n_array_elements,
+ dof_index + v + i * VectorizedArrayType::size(),
dof_values[i][v]);
}
std::integral_constant<bool, false>) const
{
for (unsigned int d = 0; d < dofs_per_cell; ++d)
- for (unsigned int v = 0; v < VectorizedArrayType::n_array_elements; ++v)
+ for (unsigned int v = 0; v < VectorizedArrayType::size(); ++v)
vector_access_add(vec, dof_indices[v] + d, dof_values[d][v]);
}
std::integral_constant<bool, true>) const
{
#if DEAL_II_COMPILER_VECTORIZATION_LEVEL < 3
- for (unsigned int v = 0; v < VectorizedArrayType::n_array_elements; ++v)
+ for (unsigned int v = 0; v < VectorizedArrayType::size(); ++v)
vector_access(vec, indices[v] + constant_offset) += res[v];
#else
// only use gather in case there is also scatter.
VectorizedArrayType &res,
std::integral_constant<bool, false>) const
{
- for (unsigned int v = 0; v < VectorizedArrayType::n_array_elements; ++v)
+ for (unsigned int v = 0; v < VectorizedArrayType::size(); ++v)
vector_access_add(vec, indices[v] + constant_offset, res[v]);
}
{
Number *vec_ptr = vec.begin() + dof_index;
for (unsigned int i = 0; i < dofs_per_cell;
- ++i, vec_ptr += VectorizedArrayType::n_array_elements)
+ ++i, vec_ptr += VectorizedArrayType::size())
dof_values[i].store(vec_ptr);
}
std::integral_constant<bool, false>) const
{
for (unsigned int i = 0; i < dofs_per_cell; ++i)
- for (unsigned int v = 0; v < VectorizedArrayType::n_array_elements; ++v)
- vector_access(vec,
- dof_index + v +
- i * VectorizedArrayType::n_array_elements) =
+ for (unsigned int v = 0; v < VectorizedArrayType::size(); ++v)
+ vector_access(vec, dof_index + v + i * VectorizedArrayType::size()) =
dof_values[i][v];
}
std::integral_constant<bool, false>) const
{
for (unsigned int i = 0; i < dofs_per_cell; ++i)
- for (unsigned int v = 0; v < VectorizedArrayType::n_array_elements; ++v)
+ for (unsigned int v = 0; v < VectorizedArrayType::size(); ++v)
vector_access(vec, dof_indices[v] + i) = dof_values[i][v];
}
VectorizedArrayType &res,
std::integral_constant<bool, false>) const
{
- for (unsigned int v = 0; v < VectorizedArrayType::n_array_elements; ++v)
+ for (unsigned int v = 0; v < VectorizedArrayType::size(); ++v)
vector_access(vec, indices[v] + constant_offset) = res[v];
}
const unsigned int max_size =
std::max(n_q_points, n_shape_values);
const unsigned int vec_length =
- dealii::VectorizedArray<double>::n_array_elements;
+ dealii::VectorizedArray<double>::size();
const unsigned int n_comp = 1 + (spacedim - 1) / vec_length;
scratch.resize((dim - 1) * max_size);
const unsigned int n_shape_values = fe.n_dofs_per_cell();
const unsigned int n_q_points = q.size();
const unsigned int max_size = std::max(n_q_points, n_shape_values);
- const unsigned int vec_length = VectorizedArray<double>::n_array_elements;
- const unsigned int n_comp = 1 + (spacedim - 1) / vec_length;
+ const unsigned int vec_length = VectorizedArray<double>::size();
+ const unsigned int n_comp = 1 + (spacedim - 1) / vec_length;
scratch.resize((dim - 1) * max_size);
values_dofs.resize(n_comp * n_shape_values);
const unsigned int n_shape_values = data.n_shape_functions;
const unsigned int n_q_points = data.shape_info.n_q_points;
- const unsigned int vec_length =
- VectorizedArray<double>::n_array_elements;
- const unsigned int n_comp = 1 + (spacedim - 1) / vec_length;
- const unsigned int n_hessians = (dim * (dim + 1)) / 2;
+ const unsigned int vec_length = VectorizedArray<double>::size();
+ const unsigned int n_comp = 1 + (spacedim - 1) / vec_length;
+ const unsigned int n_hessians = (dim * (dim + 1)) / 2;
const bool evaluate_values = update_flags & update_quadrature_points;
const bool evaluate_gradients =
prolongation_matrix_1d[i] = elem_info.prolongation_matrix_1d[i];
// reshuffle into aligned vector of vectorized arrays
- const unsigned int vec_size = VectorizedArray<Number>::n_array_elements;
+ const unsigned int vec_size = VectorizedArray<Number>::size();
const unsigned int n_levels =
dof_handler.get_triangulation().n_global_levels();
LinearAlgebra::distributed::Vector<Number> & dst,
const LinearAlgebra::distributed::Vector<Number> &src) const
{
- const unsigned int vec_size = VectorizedArray<Number>::n_array_elements;
- const unsigned int degree_size = (degree > -1 ? degree : fe_degree) + 1;
+ const unsigned int vec_size = VectorizedArray<Number>::size();
+ const unsigned int degree_size = (degree > -1 ? degree : fe_degree) + 1;
const unsigned int n_child_dofs_1d = 2 * degree_size - element_is_continuous;
const unsigned int n_scalar_cell_dofs =
Utilities::fixed_power<dim>(n_child_dofs_1d);
LinearAlgebra::distributed::Vector<Number> & dst,
const LinearAlgebra::distributed::Vector<Number> &src) const
{
- const unsigned int vec_size = VectorizedArray<Number>::n_array_elements;
- const unsigned int degree_size = (degree > -1 ? degree : fe_degree) + 1;
+ const unsigned int vec_size = VectorizedArray<Number>::size();
+ const unsigned int degree_size = (degree > -1 ? degree : fe_degree) + 1;
const unsigned int n_child_dofs_1d = 2 * degree_size - element_is_continuous;
const unsigned int n_scalar_cell_dofs =
Utilities::fixed_power<dim>(n_child_dofs_1d);
VectorizedArray<number> distance_vec;
Point<dim, VectorizedArray<number>> p1_vec, p2_vec;
- for (unsigned int v = 0; v < VectorizedArray<number>::n_array_elements; ++v)
+ for (unsigned int v = 0; v < VectorizedArray<number>::size(); ++v)
{
Point<dim, number> p1, p2;
for (unsigned int i = 0; i < dim; ++i)
distance_vec -= distance_vec2;
number diff = 0.;
- for (unsigned int v = 0; v < VectorizedArray<number>::n_array_elements; ++v)
+ for (unsigned int v = 0; v < VectorizedArray<number>::size(); ++v)
diff += std::abs(distance_vec[v]);
AssertThrow(diff < 2 * std::numeric_limits<number>::epsilon() *
- VectorizedArray<number>::n_array_elements *
- VectorizedArray<number>::n_array_elements,
+ VectorizedArray<number>::size() *
+ VectorizedArray<number>::size(),
ExcMessage("diff is " + std::to_string(diff)));
deallog << "Ok" << std::endl;
void
do_test(const VectorizedArrayType array)
{
- deallog << " test " << VectorizedArrayType::n_array_elements
- << " array elements" << std::endl;
+ deallog << " test " << VectorizedArrayType::size() << " array elements"
+ << std::endl;
auto exponentiated_array = Utilities::fixed_power<3>(array);
- for (unsigned int i = 0; i < VectorizedArrayType::n_array_elements; i++)
+ for (unsigned int i = 0; i < VectorizedArrayType::size(); i++)
deallog << exponentiated_array[i] << " ";
deallog << std::endl;
exponentiated_array = Utilities::fixed_power<-3>(array);
- for (unsigned int i = 0; i < VectorizedArrayType::n_array_elements; i++)
+ for (unsigned int i = 0; i < VectorizedArrayType::size(); i++)
deallog << exponentiated_array[i] << " ";
deallog << std::endl;
}
// since the number of array elements is system dependent, it is not a good
// idea to print them to an output file. Instead, check the values manually
VectorizedArray<Number> a, b, c;
- const unsigned int n_vectors = VectorizedArray<Number>::n_array_elements;
+ const unsigned int n_vectors = VectorizedArray<Number>::size();
a = Number(2.);
b = Number(-1.);
for (unsigned int i = 0; i < n_vectors; ++i)
test()
{
typedef VectorizedArray<double> vector_t;
- const unsigned int n_vectors = VectorizedArray<double>::n_array_elements;
+ const unsigned int n_vectors = VectorizedArray<double>::size();
typedef AlignedVector<vector_t> VEC;
std::vector<double> a_ref(4), b_ref;
VEC a(4);
weight = random_value<double>();
VectorizedArray<double> vec;
- for (unsigned int v = 0; v < VectorizedArray<double>::n_array_elements; ++v)
+ for (unsigned int v = 0; v < VectorizedArray<double>::size(); ++v)
vec[v] = random_value<double>();
current.values[0] = vec;
vector *= 2. * current.get_value(0)[0];
double error = 0;
- for (unsigned int v = 0; v < VectorizedArray<double>::n_array_elements; ++v)
+ for (unsigned int v = 0; v < VectorizedArray<double>::size(); ++v)
error += std::abs(current.get_value(0)[v] / (current.cartesian_weight[v] *
current.jac_weight[0][0]) -
(2. * vec[v] - ol[v] - weight[v] * std::sin(vec[v])));
void
test()
{
- const unsigned int n_vectors = VectorizedArray<Number>::n_array_elements;
+ const unsigned int n_vectors = VectorizedArray<Number>::size();
std::vector<Number> values(n_vectors * 5);
for (unsigned int i = 0; i < values.size(); ++i)
values[i] = i;
{
// since the number of array elements is system dependent, it is not a good
// idea to print them to an output file. Instead, check the values manually
- const unsigned int n_vectors = VectorizedArray<Number>::n_array_elements;
+ const unsigned int n_vectors = VectorizedArray<Number>::size();
VectorizedArray<Number> arr[n_numbers];
Number other[n_vectors * n_numbers];
unsigned int offsets[n_vectors];
for (unsigned int i = 0; i < vec.size(); ++i)
vec[i] = i + 1;
- const unsigned int n_vectors = VectorizedArray<Number>::n_array_elements;
+ const unsigned int n_vectors = VectorizedArray<Number>::size();
unsigned int indices[n_vectors];
for (unsigned int i = 0; i < n_vectors; ++i)
indices[i] = i;
test()
{
const unsigned int n_chunks = 50000;
- const unsigned int n_vectors = VectorizedArray<Number>::n_array_elements;
+ const unsigned int n_vectors = VectorizedArray<Number>::size();
std::vector<Number> values(n_vectors * n_chunks);
for (unsigned int i = 0; i < values.size(); ++i)
values[i] = i;
{
// since the number of array elements is system dependent, it is not a good
// idea to print them to an output file. Instead, check the values manually
- const unsigned int n_vectors =
- VectorizedArray<Number, width>::n_array_elements;
+ const unsigned int n_vectors = VectorizedArray<Number, width>::size();
VectorizedArray<Number, width> arr[n_numbers];
Number other[n_vectors * n_numbers];
unsigned int offsets[n_vectors];
do_test(const VectorizedArrayType array,
const typename VectorizedArrayType::value_type number)
{
- deallog << " test " << VectorizedArrayType::n_array_elements
- << " array elements" << std::endl;
- for (unsigned int i = 0; i < VectorizedArrayType::n_array_elements; i++)
+ deallog << " test " << VectorizedArrayType::size() << " array elements"
+ << std::endl;
+ for (unsigned int i = 0; i < VectorizedArrayType::size(); i++)
if (array[i] != number)
deallog << " problem in element " << i << std::endl;
}
void
test()
{
- constexpr unsigned int n = VectorizedArray<Number>::n_array_elements;
+ constexpr unsigned int n = VectorizedArray<Number>::size();
VectorizedArray<Number> a;
std::stringstream test_stream;
do_test(const VectorizedArrayType array,
const typename VectorizedArrayType::value_type number)
{
- deallog << " test " << VectorizedArrayType::n_array_elements
- << " array elements" << std::endl;
+ deallog << " test " << VectorizedArrayType::size() << " array elements"
+ << std::endl;
auto exponentiated_array = std::pow(array, number);
- for (unsigned int i = 0; i < VectorizedArrayType::n_array_elements; i++)
+ for (unsigned int i = 0; i < VectorizedArrayType::size(); i++)
deallog << exponentiated_array[i] << " ";
deallog << std::endl;
}
void
do_test()
{
- deallog << " test " << VectorizedArrayType::n_array_elements
- << " array elements" << std::endl;
+ deallog << " test " << VectorizedArrayType::size() << " array elements"
+ << std::endl;
VectorizedArrayType left;
- for (unsigned int i = 0; i < VectorizedArrayType::n_array_elements; i++)
+ for (unsigned int i = 0; i < VectorizedArrayType::size(); i++)
left[i] = i + 1.;
VectorizedArrayType right(3.);
{
// since the number of array elements is system dependent, it is not a good
// idea to print them to an output file. Instead, check the values manually
- const unsigned int n_vectors =
- VectorizedArray<Number, width>::n_array_elements;
+ const unsigned int n_vectors = VectorizedArray<Number, width>::size();
VectorizedArray<Number, width> arr[n_numbers];
Number other[n_vectors * n_numbers];
unsigned int offsets[n_vectors];
test_const(const VectorizedArray<Number> &vector)
{
AssertDimension(*std::max_element(vector.begin(), vector.end()),
- VectorizedArray<Number>::n_array_elements - 1);
+ VectorizedArray<Number>::size() - 1);
AssertDimension(std::distance(vector.begin(),
std::max_element(vector.begin(), vector.end())),
- VectorizedArray<Number>::n_array_elements - 1);
+ VectorizedArray<Number>::size() - 1);
AssertDimension(std::distance(vector.begin(),
vector.begin() +
- (VectorizedArray<Number>::n_array_elements -
- 1)),
- VectorizedArray<Number>::n_array_elements - 1);
+ (VectorizedArray<Number>::size() - 1)),
+ VectorizedArray<Number>::size() - 1);
}
template <typename Number>
test_nonconst(VectorizedArray<Number> &vector)
{
AssertDimension(*std::max_element(vector.begin(), vector.end()),
- VectorizedArray<Number>::n_array_elements - 1);
+ VectorizedArray<Number>::size() - 1);
AssertDimension(std::distance(vector.begin(),
std::max_element(vector.begin(), vector.end())),
- VectorizedArray<Number>::n_array_elements - 1);
+ VectorizedArray<Number>::size() - 1);
AssertDimension(std::distance(vector.begin(),
vector.begin() +
- (VectorizedArray<Number>::n_array_elements -
- 1)),
- VectorizedArray<Number>::n_array_elements - 1);
+ (VectorizedArray<Number>::size() - 1)),
+ VectorizedArray<Number>::size() - 1);
auto it = vector.begin();
- std::advance(it, VectorizedArray<Number>::n_array_elements - 1);
- AssertDimension(*it, VectorizedArray<Number>::n_array_elements - 1);
+ std::advance(it, VectorizedArray<Number>::size() - 1);
+ AssertDimension(*it, VectorizedArray<Number>::size() - 1);
}
template <typename Number>
v3(w1.size());
convert_to_vectorized(w1, v1);
- constexpr unsigned int macro_size = VectorizedArray<double>::n_array_elements;
+ constexpr unsigned int macro_size = VectorizedArray<double>::size();
Vector<double> vec_flat(v1.size() * macro_size);
std::array<unsigned int, macro_size> offsets;
for (unsigned int i = 0; i < macro_size; ++i)
v3(w1.size());
convert_to_vectorized(w1, v1);
- constexpr unsigned int macro_size = VectorizedArray<double>::n_array_elements;
+ constexpr unsigned int macro_size = VectorizedArray<double>::size();
Vector<double> vec_flat(v1.size() * macro_size);
std::array<unsigned int, macro_size> offsets;
for (unsigned int i = 0; i < macro_size; ++i)
v3(w1.size());
convert_to_vectorized(w1, v1);
- constexpr unsigned int macro_size = VectorizedArray<float>::n_array_elements;
+ constexpr unsigned int macro_size = VectorizedArray<float>::size();
Vector<float> vec_flat(v1.size() * macro_size);
std::array<unsigned int, macro_size> offsets;
for (unsigned int i = 0; i < macro_size; ++i)
v3(w1.size());
convert_to_vectorized(w1, v1);
- constexpr unsigned int macro_size = VectorizedArray<double>::n_array_elements;
+ constexpr unsigned int macro_size = VectorizedArray<double>::size();
Vector<double> vec_flat(v1.size() * macro_size);
std::array<unsigned int, macro_size> offsets;
for (unsigned int i = 0; i < macro_size; ++i)
{
Tensor<1, dim, VectorizedArray<NumberType>> shift_vec;
Point<dim> p;
- for (unsigned int v = 0; v < VectorizedArray<NumberType>::n_array_elements;
- ++v)
+ for (unsigned int v = 0; v < VectorizedArray<NumberType>::size(); ++v)
{
for (unsigned int d = 0; d < dim; ++d)
p[d] = p_vec[d][v];
const auto &qp = fe_eval.quadrature_point(q);
const auto v2 = qp + displacement_function.shift_value(qp);
VectorizedArray<NumberType> dist = v1.distance(v2);
- for (unsigned int v = 0;
- v < VectorizedArray<NumberType>::n_array_elements;
+ for (unsigned int v = 0; v < VectorizedArray<NumberType>::size();
++v)
AssertThrow(dist[v] < 1e-8,
ExcMessage("distance: " + std::to_string(dist[v])));
const auto v2 = qp + displacement_function.shift_value(qp);
VectorizedArray<NumberType> dist = v1.distance(v2);
for (unsigned int v = 0;
- v < VectorizedArray<NumberType>::n_array_elements;
+ v < VectorizedArray<NumberType>::size();
++v)
AssertThrow(dist[v] < 1e-8,
ExcMessage(
FEEvaluation<dim, fe_degree, n_q_points_1d, n_components, number> phi(
data, 0, 0, start_vector_component);
- const unsigned int n_vect = VectorizedArray<number>::n_array_elements;
+ const unsigned int n_vect = VectorizedArray<number>::size();
for (unsigned int cell = cell_range.first; cell < cell_range.second; ++cell)
{
n_components,
number>::value_type value_type;
- const unsigned int n_vect = VectorizedArray<number>::n_array_elements;
+ const unsigned int n_vect = VectorizedArray<number>::size();
for (unsigned int face = face_range.first; face < face_range.second; face++)
{
n_components,
number>::value_type value_type;
- const unsigned int n_vect = VectorizedArray<number>::n_array_elements;
+ const unsigned int n_vect = VectorizedArray<number>::size();
for (unsigned int face = face_range.first; face < face_range.second; face++)
{
for (unsigned int v = 0; v < n_vect; ++v)
{
std::bitset<n_vect> mask =
- std::bitset<VectorizedArray<number>::n_array_elements>();
+ std::bitset<VectorizedArray<number>::size()>();
mask[v] = true;
fe_eval.distribute_local_to_global(dst, 0, mask);
}
fe_eval.reinit(cell);
for (unsigned int i = 0; i < dofs_per_cell;
- i += VectorizedArray<double>::n_array_elements)
+ i += VectorizedArray<double>::size())
{
const unsigned int n_items =
- i + VectorizedArray<double>::n_array_elements > dofs_per_cell ?
+ i + VectorizedArray<double>::size() > dofs_per_cell ?
(dofs_per_cell - i) :
- VectorizedArray<double>::n_array_elements;
+ VectorizedArray<double>::size();
for (unsigned int j = 0; j < dofs_per_cell; ++j)
fe_eval.begin_dof_values()[j] = VectorizedArray<double>();
for (unsigned int v = 0; v < n_items; ++v)
const unsigned int dofs_per_cell_u = phi_u.dofs_per_cell;
const unsigned int dofs_per_cell_p = phi_p.dofs_per_cell;
for (unsigned int i = 0; i < dofs_per_cell_u;
- i += VectorizedArray<double>::n_array_elements)
+ i += VectorizedArray<double>::size())
{
const unsigned int n_items =
- i + VectorizedArray<double>::n_array_elements > dofs_per_cell_u ?
+ i + VectorizedArray<double>::size() > dofs_per_cell_u ?
(dofs_per_cell_u - i) :
- VectorizedArray<double>::n_array_elements;
+ VectorizedArray<double>::size();
for (unsigned int j = 0; j < dofs_per_cell_u; ++j)
phi_u.begin_dof_values()[j] = VectorizedArray<double>();
for (unsigned int v = 0; v < n_items; ++v)
}
for (unsigned int i = 0; i < dofs_per_cell_p;
- i += VectorizedArray<double>::n_array_elements)
+ i += VectorizedArray<double>::size())
{
const unsigned int n_items =
- i + VectorizedArray<double>::n_array_elements > dofs_per_cell_p ?
+ i + VectorizedArray<double>::size() > dofs_per_cell_p ?
(dofs_per_cell_p - i) :
- VectorizedArray<double>::n_array_elements;
+ VectorizedArray<double>::size();
for (unsigned int j = 0; j < dofs_per_cell_p; ++j)
phi_p.begin_dof_values()[j] = VectorizedArray<double>();
for (unsigned int v = 0; v < n_items; ++v)
FEEvaluation<dim, fe_degree> &fe_eval = data.fe_eval[0];
fe_eval.reinit(cell);
for (unsigned int i = 0; i < dofs_per_cell;
- i += VectorizedArray<double>::n_array_elements)
+ i += VectorizedArray<double>::size())
{
const unsigned int n_items =
- i + VectorizedArray<double>::n_array_elements > dofs_per_cell ?
+ i + VectorizedArray<double>::size() > dofs_per_cell ?
(dofs_per_cell - i) :
- VectorizedArray<double>::n_array_elements;
+ VectorizedArray<double>::size();
for (unsigned int j = 0; j < dofs_per_cell; ++j)
fe_eval.begin_dof_values()[j] = VectorizedArray<double>();
for (unsigned int v = 0; v < n_items; ++v)
compare_indices(const MatrixFree<dim, number> *mf_data)
{
const unsigned int n_batches = mf_data->n_macro_cells();
- constexpr unsigned int batch_size = VectorizedArray<number>::n_array_elements;
+ constexpr unsigned int batch_size = VectorizedArray<number>::size();
for (unsigned int batch_no = 0; batch_no < n_batches; ++batch_no)
{
const unsigned int n_lanes_filled =
phif.inverse_jacobian(0))[dim - 1]) *
(number)(std::max(1, fe_degree) * (fe_degree + 1.0)) * 2.;
- std::array<types::boundary_id,
- VectorizedArray<number>::n_array_elements>
+ std::array<types::boundary_id, VectorizedArray<number>::size()>
boundary_ids = data.get_faces_by_cells_boundary_id(cell, face);
VectorizedArray<number> factor_boundary;
- for (unsigned int v = 0;
- v < VectorizedArray<number>::n_array_elements;
- ++v)
+ for (unsigned int v = 0; v < VectorizedArray<number>::size(); ++v)
// interior face
if (boundary_ids[v] == numbers::invalid_boundary_id)
factor_boundary[v] = 0.5;
n_inner_other_faces(2 * dim), n_boundary_faces(2 * dim);
for (unsigned int f = 0; f < mf_data.n_inner_face_batches(); ++f)
{
- for (unsigned int v = 0;
- v < VectorizedArray<double>::n_array_elements;
- ++v)
+ for (unsigned int v = 0; v < VectorizedArray<double>::size(); ++v)
if (mf_data.get_face_info(f).cells_interior[v] !=
numbers::invalid_unsigned_int)
{
mf_data.n_inner_face_batches() + mf_data.n_boundary_face_batches();
++f)
{
- for (unsigned int v = 0;
- v < VectorizedArray<double>::n_array_elements;
- ++v)
+ for (unsigned int v = 0; v < VectorizedArray<double>::size(); ++v)
if (mf_data.get_face_info(f).cells_interior[v] !=
numbers::invalid_unsigned_int)
{
mf_data->reinit(dof, constraints, quad, data);
}
- const unsigned int n_cells = mf_data->n_macro_cells();
- const auto & dof_info = mf_data->get_dof_info();
- constexpr unsigned int n_vectorization =
- VectorizedArray<number>::n_array_elements;
+ const unsigned int n_cells = mf_data->n_macro_cells();
+ const auto & dof_info = mf_data->get_dof_info();
+ constexpr unsigned int n_vectorization = VectorizedArray<number>::size();
std::vector<unsigned int> my_rows;
my_rows.reserve(fe.dofs_per_cell * n_vectorization);
mf_data->reinit(dof, constraints, quad, data);
}
- const unsigned int n_cells = mf_data->n_macro_cells();
- const auto & dof_info = mf_data->get_dof_info();
- constexpr unsigned int n_vectorization =
- VectorizedArray<number>::n_array_elements;
+ const unsigned int n_cells = mf_data->n_macro_cells();
+ const auto & dof_info = mf_data->get_dof_info();
+ constexpr unsigned int n_vectorization = VectorizedArray<number>::size();
std::vector<unsigned int> my_rows;
my_rows.reserve(fe.dofs_per_cell * n_vectorization);
{
const QGauss<1> quad(fe_degree + 1);
typename MatrixFree<dim, number>::AdditionalData data;
- data.tasks_block_size = 8 / VectorizedArray<number>::n_array_elements;
+ data.tasks_block_size = 8 / VectorizedArray<number>::size();
mf_data.reinit(dof, constraints, quad, data);
}
VectorizedArray<double> x[N], x_ref[N], y[M], y_ref[M];
for (unsigned int i = 0; i < N; ++i)
- for (unsigned int v = 0; v < VectorizedArray<double>::n_array_elements; ++v)
+ for (unsigned int v = 0; v < VectorizedArray<double>::size(); ++v)
x[i][v] = random_value<double>();
// compute reference
for (unsigned int i = 0; i < M; ++i)
{
deallog << y[i][0] - y_ref[i][0] << " ";
- for (unsigned int v = 1; v < VectorizedArray<double>::n_array_elements;
- ++v)
+ for (unsigned int v = 1; v < VectorizedArray<double>::size(); ++v)
AssertThrow(std::abs(y[i][v] - y_ref[i][v]) < 1e-12,
ExcInternalError());
}
for (unsigned int i = 0; i < M; ++i)
- for (unsigned int v = 0; v < VectorizedArray<double>::n_array_elements; ++v)
+ for (unsigned int v = 0; v < VectorizedArray<double>::size(); ++v)
y[i][v] = random_value<double>();
// compute reference
for (unsigned int i = 0; i < N; ++i)
{
deallog << x[i][0] - x_ref[i][0] << " ";
- for (unsigned int v = 1; v < VectorizedArray<double>::n_array_elements;
- ++v)
+ for (unsigned int v = 1; v < VectorizedArray<double>::size(); ++v)
AssertThrow(std::abs(x[i][v] - x_ref[i][v]) < 1e-12,
ExcInternalError());
}
VectorizedArray<double> x[N], x_ref[N], y[M], y_ref[M];
for (unsigned int i = 0; i < N; ++i)
- for (unsigned int v = 0; v < VectorizedArray<double>::n_array_elements; ++v)
+ for (unsigned int v = 0; v < VectorizedArray<double>::size(); ++v)
x[i][v] = random_value<double>();
// compute reference
for (unsigned int i = 0; i < M; ++i)
{
deallog << y[i][0] - y_ref[i][0] << " ";
- for (unsigned int v = 1; v < VectorizedArray<double>::n_array_elements;
- ++v)
+ for (unsigned int v = 1; v < VectorizedArray<double>::size(); ++v)
AssertThrow(std::abs(y[i][v] - y_ref[i][v]) < 1e-12,
ExcInternalError());
}
deallog << std::endl;
for (unsigned int i = 0; i < M; ++i)
- for (unsigned int v = 0; v < VectorizedArray<double>::n_array_elements; ++v)
+ for (unsigned int v = 0; v < VectorizedArray<double>::size(); ++v)
y[i][v] = random_value<double>();
// compute reference
for (unsigned int i = 0; i < N; ++i)
{
deallog << x[i][0] - x_ref[i][0] << " ";
- for (unsigned int v = 1; v < VectorizedArray<double>::n_array_elements;
- ++v)
+ for (unsigned int v = 1; v < VectorizedArray<double>::size(); ++v)
AssertThrow(std::abs(x[i][v] - x_ref[i][v]) < 1e-12,
ExcInternalError());
}
VectorizedArray<double> x[N], x_ref[N], y[M], y_ref[M];
for (unsigned int i = 0; i < N; ++i)
- for (unsigned int v = 0; v < VectorizedArray<double>::n_array_elements; ++v)
+ for (unsigned int v = 0; v < VectorizedArray<double>::size(); ++v)
x[i][v] = random_value<double>();
// compute reference
for (unsigned int i = 0; i < M; ++i)
{
deallog << y[i][0] - y_ref[i][0] << " ";
- for (unsigned int v = 1; v < VectorizedArray<double>::n_array_elements;
- ++v)
+ for (unsigned int v = 1; v < VectorizedArray<double>::size(); ++v)
AssertThrow(std::abs(y[i][v] - y_ref[i][v]) < 1e-12,
ExcInternalError());
}
for (unsigned int i = 0; i < M; ++i)
- for (unsigned int v = 0; v < VectorizedArray<double>::n_array_elements; ++v)
+ for (unsigned int v = 0; v < VectorizedArray<double>::size(); ++v)
y[i][v] = random_value<double>();
// compute reference
for (unsigned int i = 0; i < N; ++i)
{
deallog << x[i][0] - x_ref[i][0] << " ";
- for (unsigned int v = 1; v < VectorizedArray<double>::n_array_elements;
- ++v)
+ for (unsigned int v = 1; v < VectorizedArray<double>::size(); ++v)
AssertThrow(std::abs(x[i][v] - x_ref[i][v]) < 1e-12,
ExcInternalError());
}
{
VectorizedArray<number> diff =
(ref.get_value(q) - check.get_value(q));
- for (unsigned int v = 0;
- v < VectorizedArray<number>::n_array_elements;
- ++v)
+ for (unsigned int v = 0; v < VectorizedArray<number>::size(); ++v)
{
if (std::abs(diff[v]) > 1e-12)
{
{
VectorizedArray<number> diff =
(refr.get_value(q) - checkr.get_value(q));
- for (unsigned int v = 0;
- v < VectorizedArray<number>::n_array_elements;
- ++v)
+ for (unsigned int v = 0; v < VectorizedArray<number>::size(); ++v)
{
if (std::abs(diff[v]) > 1e-12)
{
{
VectorizedArray<number> diff =
(ref.get_value(q) - check.get_value(q));
- for (unsigned int v = 0;
- v < VectorizedArray<number>::n_array_elements;
- ++v)
+ for (unsigned int v = 0; v < VectorizedArray<number>::size(); ++v)
{
if (std::abs(diff[v]) > 1e-12)
{
{
VectorizedArray<number> diff =
(refr.get_value(q) - checkr.get_value(q));
- for (unsigned int v = 0;
- v < VectorizedArray<number>::n_array_elements;
- ++v)
+ for (unsigned int v = 0; v < VectorizedArray<number>::size(); ++v)
{
if (std::abs(diff[v]) > 1e-12)
{
// FEEvaluations. Those are tested in other
// functions and seen as reference here
for (unsigned int q = 0; q < fe_eval.n_q_points; ++q)
- for (unsigned int j = 0; j < VectorizedArray<Number>::n_array_elements;
- ++j)
+ for (unsigned int j = 0; j < VectorizedArray<Number>::size(); ++j)
{
errors[0] +=
std::fabs(fe_eval.get_value(q)[j] - fe_eval2.get_value(q)[j]);
// FEEvaluations. Those are tested in other
// functions and seen as reference here
for (unsigned int q = 0; q < fe_eval.n_q_points; ++q)
- for (unsigned int j = 0; j < VectorizedArray<Number>::n_array_elements;
- ++j)
+ for (unsigned int j = 0; j < VectorizedArray<Number>::size(); ++j)
{
errors[0] +=
std::fabs(fe_eval.get_value(q)[j] - fe_eval2.get_value(q)[j]);
fe_eval_plain.read_dof_values_plain(src);
for (unsigned int i = 0; i < fe_eval.dofs_per_cell; ++i)
- for (unsigned int j = 0;
- j < VectorizedArray<Number>::n_array_elements;
- ++j)
+ for (unsigned int j = 0; j < VectorizedArray<Number>::size(); ++j)
{
error += std::fabs(fe_eval.get_dof_value(i)[j] -
fe_eval_plain.get_dof_value(i)[j]);
fe_evalp.read_dof_values(src);
fe_evalp.evaluate(true, true);
- for (unsigned int j = 0; j < VectorizedArray<Number>::n_array_elements;
- ++j)
+ for (unsigned int j = 0; j < VectorizedArray<Number>::size(); ++j)
{
// skip empty components in VectorizedArray
if (data.get_face_info(face).cells_interior[j] ==
fe_evalm.read_dof_values(src);
fe_evalm.evaluate(true, true);
- for (unsigned int j = 0; j < VectorizedArray<Number>::n_array_elements;
- ++j)
+ for (unsigned int j = 0; j < VectorizedArray<Number>::size(); ++j)
{
// skip empty components in VectorizedArray
if (data.get_face_info(face).cells_interior[j] ==
{
VectorizedArray<double> res = make_vectorized_array(0.);
Point<dim> p;
- for (unsigned int v = 0; v < VectorizedArray<double>::n_array_elements; ++v)
+ for (unsigned int v = 0; v < VectorizedArray<double>::size(); ++v)
{
for (unsigned int d = 0; d < dim; d++)
p[d] = p_vec[d][v];
{
public:
typedef VectorizedArray<Number> vector_t;
- static const std::size_t n_vectors =
- VectorizedArray<Number>::n_array_elements;
+ static const std::size_t n_vectors = VectorizedArray<Number>::size();
MatrixFreeTest(const MatrixFree<dim, Number> &data_in)
: data(data_in){};
{
public:
typedef VectorizedArray<Number> vector_t;
- static const std::size_t n_vectors =
- VectorizedArray<Number>::n_array_elements;
+ static const std::size_t n_vectors = VectorizedArray<Number>::size();
MatrixFreeTest(const MatrixFree<dim, Number> &data_in)
: data(data_in){};
{
public:
typedef VectorizedArray<Number> vector_t;
- static const std::size_t n_vectors =
- VectorizedArray<Number>::n_array_elements;
+ static const std::size_t n_vectors = VectorizedArray<Number>::size();
MatrixFreeTest(const MatrixFree<dim, Number> &data_in)
: data(data_in){};
{
public:
typedef VectorizedArray<Number> vector_t;
- static const std::size_t n_vectors =
- VectorizedArray<Number>::n_array_elements;
+ static const std::size_t n_vectors = VectorizedArray<Number>::size();
MatrixFreeTest(const MatrixFree<dim, Number> &data_in)
: data(data_in){};
{
public:
typedef VectorizedArray<Number> vector_t;
- static const std::size_t n_vectors =
- VectorizedArray<Number>::n_array_elements;
+ static const std::size_t n_vectors = VectorizedArray<Number>::size();
MatrixFreeTest(const MatrixFree<dim, Number> &data_in)
: data(data_in){};
{
public:
typedef VectorizedArray<Number> vector_t;
- static const std::size_t n_vectors =
- VectorizedArray<Number>::n_array_elements;
+ static const std::size_t n_vectors = VectorizedArray<Number>::size();
MatrixFreeTest(const MatrixFree<dim, Number> &data_in)
: data(data_in){};
{
value_type average_value =
(fe_eval.get_value(q) - fe_eval_neighbor.get_value(q)) *
- make_vectorized_array<number,
- VectorizedArrayType::n_array_elements>(0.5);
+ make_vectorized_array<number, VectorizedArrayType::size()>(0.5);
value_type average_valgrad =
fe_eval.get_normal_derivative(q) +
fe_eval_neighbor.get_normal_derivative(q);
average_valgrad =
average_value * sigmaF -
average_valgrad *
- make_vectorized_array<number,
- VectorizedArrayType::n_array_elements>(
- 0.5);
+ make_vectorized_array<number, VectorizedArrayType::size()>(0.5);
fe_eval.submit_normal_derivative(-average_value, q);
fe_eval_neighbor.submit_normal_derivative(-average_value, q);
fe_eval.submit_value(average_valgrad, q);
{
value_type average_value =
(fe_eval.get_value(q) - fe_eval_neighbor.get_value(q)) *
- make_vectorized_array<number,
- VectorizedArrayType::n_array_elements>(0.5);
+ make_vectorized_array<number, VectorizedArrayType::size()>(0.5);
value_type average_valgrad =
fe_eval.get_normal_derivative(q) +
fe_eval_neighbor.get_normal_derivative(q);
average_valgrad =
average_value * sigmaF -
average_valgrad *
- make_vectorized_array<number,
- VectorizedArrayType::n_array_elements>(
- 0.5);
+ make_vectorized_array<number, VectorizedArrayType::size()>(0.5);
fe_eval.submit_normal_derivative(-average_value, q);
fe_eval_neighbor.submit_normal_derivative(-average_value, q);
fe_eval.submit_value(average_valgrad, q);
const VectorizedArrayType normal_times_advection =
advection * phi_m.get_normal_vector(q);
const value_type flux_times_normal =
- make_vectorized_array<number,
- VectorizedArrayType::n_array_elements>(
- 0.5) *
+ make_vectorized_array<number, VectorizedArrayType::size()>(0.5) *
((u_minus + u_plus) * normal_times_advection +
std::abs(normal_times_advection) * (u_minus - u_plus));
phi_m.submit_value(-flux_times_normal, q);
number,
VectorizedArrayType>::value_type value_type;
value_type u_plus;
- u_plus =
- make_vectorized_array<number, VectorizedArrayType::n_array_elements>(1.3);
+ u_plus = make_vectorized_array<number, VectorizedArrayType::size()>(1.3);
for (unsigned int face = face_range.first; face < face_range.second; face++)
{
const VectorizedArrayType normal_times_advection =
advection * fe_eval.get_normal_vector(q);
const value_type flux_times_normal =
- make_vectorized_array<number,
- VectorizedArrayType::n_array_elements>(
- 0.5) *
+ make_vectorized_array<number, VectorizedArrayType::size()>(0.5) *
((u_minus + u_plus) * normal_times_advection +
std::abs(normal_times_advection) * (u_minus - u_plus));
fe_eval.submit_value(-flux_times_normal, q);
std::abs((phif.get_normal_vector(0) *
phif.inverse_jacobian(0))[dim - 1]) *
(number)(std::max(1, fe_degree) * (fe_degree + 1.0)) * 2.;
- std::array<types::boundary_id,
- VectorizedArray<number>::n_array_elements>
+ std::array<types::boundary_id, VectorizedArray<number>::size()>
boundary_ids = data.get_faces_by_cells_boundary_id(cell, face);
VectorizedArray<number> factor_boundary;
- for (unsigned int v = 0;
- v < VectorizedArray<number>::n_array_elements;
- ++v)
+ for (unsigned int v = 0; v < VectorizedArray<number>::size(); ++v)
// interior face
if (boundary_ids[v] == numbers::invalid_boundary_id)
factor_boundary[v] = 0.5;
// values should evaluate to one, derivatives to zero
for (unsigned int q = 0; q < fe_eval.n_q_points; ++q)
- for (unsigned int d = 0;
- d < VectorizedArray<Number>::n_array_elements;
- ++d)
+ for (unsigned int d = 0; d < VectorizedArray<Number>::size(); ++d)
{
Assert(fe_eval.get_value(q)[d] == 1., ExcInternalError());
for (unsigned int e = 0; e < dim; ++e)
}
}
- AlignedVector<std::array<CellId, VectorizedArrayType::n_array_elements>>
- cell_ids;
+ AlignedVector<std::array<CellId, VectorizedArrayType::size()>> cell_ids;
};
}
}
- AlignedVector<std::array<CellId, VectorizedArrayType::n_array_elements>>
- cell_ids;
+ AlignedVector<std::array<CellId, VectorizedArrayType::size()>> cell_ids;
};
// components (should be stable irrespective of vectorization
// width)
if (q == 0)
- for (unsigned int v = 0;
- v < VectorizedArray<double>::n_array_elements;
- ++v)
+ for (unsigned int v = 0; v < VectorizedArray<double>::size(); ++v)
deallog << submit_value[v] << " = " << simple_value[v] << " - "
<< sin_value[v] << std::endl;
}
{
VectorizedArray<number> return_value =
make_vectorized_array<number>(1.);
- for (unsigned int i = 0;
- i < VectorizedArray<number>::n_array_elements;
- ++i)
+ for (unsigned int i = 0; i < VectorizedArray<number>::size(); ++i)
{
Point<dim> p;
for (unsigned int d = 0; d < dim; ++d)
{
VectorizedArray<number> return_value =
make_vectorized_array<number>(1.);
- for (unsigned int i = 0;
- i < VectorizedArray<number>::n_array_elements;
- ++i)
+ for (unsigned int i = 0; i < VectorizedArray<number>::size(); ++i)
{
Point<dim> p;
for (unsigned int d = 0; d < dim; ++d)
{
VectorizedArray<number> return_value =
make_vectorized_array<number>(1.);
- for (unsigned int i = 0;
- i < VectorizedArray<number>::n_array_elements;
- ++i)
+ for (unsigned int i = 0; i < VectorizedArray<number>::size(); ++i)
{
Point<dim> p;
for (unsigned int d = 0; d < dim; ++d)
for (unsigned int d = 0; d < dim; ++d)
rhs_u[d] = make_vectorized_array<double>(1.0);
VectorizedArray<double> rhs_p = make_vectorized_array<double>(1.0);
- for (unsigned int i = 0;
- i < VectorizedArray<double>::n_array_elements;
- ++i)
+ for (unsigned int i = 0; i < VectorizedArray<double>::size(); ++i)
{
Point<dim> p;
for (unsigned int d = 0; d < dim; ++d)
{
VectorizedArray<double> res = make_vectorized_array(0.);
Point<dim> p;
- for (unsigned int v = 0; v < VectorizedArray<double>::n_array_elements; ++v)
+ for (unsigned int v = 0; v < VectorizedArray<double>::size(); ++v)
{
for (unsigned int d = 0; d < dim; d++)
p[d] = p_vec[d][v];
{
VectorizedArray<double> res = make_vectorized_array(0.);
Point<dim> p;
- for (unsigned int v = 0; v < VectorizedArray<double>::n_array_elements; ++v)
+ for (unsigned int v = 0; v < VectorizedArray<double>::size(); ++v)
{
for (unsigned int d = 0; d < dim; d++)
p[d] = p_vec[d][v];
// Scale the gradients along the vectorization-index so that each grad_u[v] is
// unique.
- for (unsigned int v = 0; v < VectorizedArray<double>::n_array_elements; v++)
+ for (unsigned int v = 0; v < VectorizedArray<double>::size(); v++)
for (unsigned int i = 0; i < dim; i++)
for (unsigned int j = 0; j < dim; j++)
grad_u[i][j][v] *= (v + 1);
// You can't use .norm() on some difference-tensor of the two so we compare
// element-wise!
- for (unsigned int v = 0; v < VectorizedArray<double>::n_array_elements; v++)
+ for (unsigned int v = 0; v < VectorizedArray<double>::size(); v++)
for (unsigned int i = 0; i < dim; i++)
for (unsigned int j = 0; j < dim; j++)
if (F_solution[i][j][v] - F_test[i][j][v] != 0.0)
SymmetricTensor<2, dim, VectorizedArray<double>> E_test =
Kinematics::E(F_test);
- for (unsigned int v = 0; v < VectorizedArray<double>::n_array_elements; v++)
+ for (unsigned int v = 0; v < VectorizedArray<double>::size(); v++)
for (unsigned int i = 0; i < dim; i++)
for (unsigned int j = 0; j < dim; j++)
if (E_test[i][j][v] - E_solution[i][j][v] != 0.0)
Tensor<2, dim, VectorizedArray<double>> F_iso_test;
F_iso_test = Kinematics::F_iso(F_test);
- for (unsigned int v = 0; v < VectorizedArray<double>::n_array_elements; v++)
+ for (unsigned int v = 0; v < VectorizedArray<double>::size(); v++)
for (unsigned int i = 0; i < dim; i++)
for (unsigned int j = 0; j < dim; j++)
if (F_iso_test[i][j][v] - F_iso_solution[i][j][v] != 0.0)
deallog << r1[i][j][0] << std::endl;
AssertThrow(std::abs(r1[i][j][0] - factor_float * s1[i][j][0]) < 1.e-10,
ExcInternalError());
- for (unsigned int k = 1; k < VectorizedArray<float>::n_array_elements;
- ++k)
+ for (unsigned int k = 1; k < VectorizedArray<float>::size(); ++k)
{
AssertThrow(std::abs(r1[i][j][k] - r1[i][j][0]) < 1.e-10,
ExcInternalError());
deallog << r2[i][j][0] << std::endl;
Assert(std::abs(r2[i][j][0] - factor_double * s2[i][j][0]) < 1.e-10,
ExcInternalError());
- for (unsigned int k = 1; k < VectorizedArray<double>::n_array_elements;
- ++k)
+ for (unsigned int k = 1; k < VectorizedArray<double>::size(); ++k)
{
AssertThrow(std::abs(r2[i][j][k] - r2[i][j][0]) < 1.e-10,
ExcInternalError());
Number counter = 0.0;
for (unsigned int i = 0; i < dim; ++i)
for (unsigned int j = 0; j < dim; ++j)
- for (unsigned int v = 0;
- v < dealii::VectorizedArray<Number>::n_array_elements;
- v++)
+ for (unsigned int v = 0; v < dealii::VectorizedArray<Number>::size(); v++)
{
A[i][j][v] = counter;
counter += 1.0;
// like VectorizedArray<double> frob_norm = B.norm() -> Maybe a TODO?
for (unsigned int i = 0; i < dim; ++i)
for (unsigned int j = 0; j < dim; ++j)
- for (unsigned int v = 0; v < VectorizedArray<double>::n_array_elements;
- ++v)
+ for (unsigned int v = 0; v < VectorizedArray<double>::size(); ++v)
if (B[i][j][v] != 0.0)
deallog << "Not OK" << std::endl;