@@ -43,6 +43,7 @@ class CEdge {
4343 using NodeArray = C2DContainer<Index, Index, StorageType::ColumnMajor, 64 , DynamicSize, 2 >;
4444 NodeArray Nodes; /* !< \brief Vector to store the node indices of the edge. */
4545 su2activematrix Normal; /* !< \brief Normal (area) of the edge. */
46+ const Index nEdge, nEdgeSIMD;
4647
4748 friend class CPhysicalGeometry ;
4849
@@ -70,13 +71,27 @@ class CEdge {
7071 inline unsigned long GetNode (unsigned long iEdge, unsigned long iNode) const { return Nodes (iEdge,iNode); }
7172
7273 /* !
73- * \brief SIMD version of GetNode, iNode returned for multiple contiguous iEdges
74+ * \brief SIMD version of GetNode, iNode returned for contiguous iEdges.
7475 */
7576 template <class T , size_t N>
7677 FORCEINLINE simd::Array<T,N> GetNode (simd::Array<T,N> iEdge, unsigned long iNode) const {
7778 return simd::Array<T,N>(&Nodes (iEdge[0 ],iNode));
7879 }
7980
81+ /* !
82+ * \brief Sets the tail of "Nodes" to repeat one of the last edges.
83+ * \note This is needed when using the SIMD version of GetNode and
84+ * the number of edges is not a multiple of the simd width.
85+ */
86+ void SetPaddingNodes () {
87+ for (auto iEdge = nEdge; iEdge < nEdgeSIMD; ++iEdge) {
88+ /* --- Pad nodes by repeating the first edge in the last SIMD group. ---*/
89+ const auto iEdge0 = nEdgeSIMD - simd::preferredLen<su2double>();
90+ Nodes (iEdge, LEFT) = Nodes (iEdge0, LEFT);
91+ Nodes (iEdge, RIGHT) = Nodes (iEdge0, RIGHT);
92+ }
93+ }
94+
8095 /* !
8196 * \brief Set the node indices of an edge.
8297 * \param[in] iEdge - Edge index.
0 commit comments