Go to the documentation of this file.
44 points.push_back(tri.
x());
45 newTri.
x() =
static_cast<int32>(points.
size()) - 1;
56 points.push_back(tri.
y());
57 newTri.
y() =
static_cast<int32>(points.
size()) - 1;
68 points.push_back(tri.
z());
69 newTri.
z() =
static_cast<int32>(points.
size()) - 1;
73 vertices.push_back( newTri );
78 return static_cast<int32>(vertices.
size()) -1;
90 Kokkos::parallel_reduce(
91 "triSurface::calcMaxIndex",
94 valueToUpdate =
max(valueToUpdate,
max(verDeviceVec[i]));
96 Kokkos::Max<int32>( maxIdx )
106 auto maxIdx = calcMaxIndex();
108 if( maxIdx >=
static_cast<int32>(points_.size()))
return false;
117 vertices_(
"vertices"),
128 points_(
"points",
"points", points),
129 vertices_(
"vertices",
"vertices", vertices),
130 area_(
"area",
"area"),
136 "the indices and number of points do not match. \n";
140 area_.reallocate(vertices_.capacity(), vertices_.size());
153 vertices_(
"vertices"),
163 for(
const auto& tr: triangles)
165 if(
auto i= addTriangle(tr, points, vertices); i < 0 )
168 "failed to insert a triangle into triSurface. \n";
173 points_.assign(points);
175 vertices_.assign(vertices);
177 area_.reallocate(vertices_.capacity(), vertices_.size());
184 "the indices and number of points do not match. \n";
201 if(!points_.read(is))
return false;
204 if(!vertices_.read(is,
true))
return false;
209 "the indices and number of points do not match. \n";
213 area_.reallocate(vertices_.capacity(), vertices_.size());
int64 find(Vector< T, Allocator > &vec, const T &val)
int32 calcMaxIndex() const
iOstream & endl(iOstream &os)
Add newline and flush stream.
bool writeTriSurface(iOstream &os) const
INLINE_FUNCTION_HD T & y()
virtual bool check(const char *operation) const
Check IOstream status for given operation.
int32x3Field_D vertices_
vectices indices of triangles
#define fatalErrorInFunction
bool fatalCheck(const char *operation) const
Check IOstream status for given operation.
INLINE_FUNCTION_H bool calculateArea(const realx3Field_D &points, const int32x3Field_D &vertices, realField_D &area)
virtual const word & name() const
Return the name of the stream.
INLINE_FUNCTION_HD T & z()
T max(const Vector< T, Allocator > &v)
bool isBinary() const
Return true if stream format is binray.
#define ioErrorInFile(fileName, lineNumber)
int32 lineNumber() const
Const access to the current stream line number.
INLINE_FUNCTION_HD T & x()
INLINE_FUNCTION_H size_t size() const
INLINE_FUNCTION_H viewType & deviceVectorAll()
bool readTriSurface(iIstream &is)
int32 addTriangle(const realx3x3 &tri, realx3Vector &points, int32x3Vector &vertices)