Go to the documentation of this file.
35 #include "vtkFloatArray.h"
36 #include "vtkCellData.h"
37 #include "vtkPointData.h"
38 #include "vtkSmartPointer.h"
47 for (
const auto&
f : faces)
58 auto iter = list.
begin();
59 for (
const auto&
f : faces)
63 for (
const label verti :
f)
73 template<
class PatchType>
82 template<
class PatchType>
90 template<
class PatchType>
97 vtkmesh->SetPolys(faces(
p));
120 template<
class PatchType>
126 array->SetNumberOfComponents(3);
127 array->SetNumberOfTuples(
p.size());
134 if (
p.hasFaceNormals())
136 for (
const vector&
n :
p.faceNormals())
138 array->SetTuple(
faceId++,
n.v_);
143 for (
const auto&
f :
p)
145 const vector n(
f.unitNormal(
p.points()));
146 array->SetTuple(
faceId++,
n.v_);
154 template<
class PatchType>
160 vtkpoints->SetNumberOfPoints(
p.size());
165 vtkIdType pointId = 0;
167 if (
p.hasFaceCentres())
169 for (
const point& pt :
p.faceCentres())
171 vtkpoints->SetPoint(pointId++, pt.v_);
176 for (
const auto&
f :
p)
178 const point pt(
f.centre(
p.points()));
179 vtkpoints->SetPoint(pointId++, pt.
v_);
195 vtkFloatArray* array,
202 if (array->GetNumberOfComponents() != nComp)
205 <<
"vtk array '" << array->GetName()
206 <<
"' has mismatch in number of components for type '"
208 <<
"' : target array has " << array->GetNumberOfComponents()
209 <<
" components instead of " << nComp
213 const vtkIdType maxSize = array->GetNumberOfTuples();
214 const vtkIdType endPos =
start + vtkIdType(input.
size());
221 else if (
start < 0 || vtkIdType(
start) >= maxSize)
224 <<
"vtk array '" << array->GetName()
225 <<
"' copy with out-of-range [0," << long(maxSize) <<
")"
226 <<
" starting at " << long(
start)
231 else if (endPos > maxSize)
234 <<
"vtk array '" << array->GetName()
235 <<
"' copy ends out-of-range (" << long(maxSize) <<
")"
236 <<
" using sizing (start,size) = ("
237 << long(
start) <<
"," << input.
size() <<
")"
243 float scratch[pTraits<Type>::nComponents];
245 for (
const Type&
val : input)
248 array->SetTuple(
start++, scratch);
267 data->SetNumberOfTuples(size);
270 #if (VTK_MAJOR_VERSION < 8)
271 for (
int i = 0; i <
data->GetNumberOfComponents(); ++i)
273 data->FillComponent(i, 0);
295 data->SetNumberOfTuples(
fld.size());
label ListType::const_reference val
A class for handling words, derived from Foam::string.
Cmpt v_[Ncmpts]
The components of this vector space.
iterator begin()
Return an iterator to begin traversing the UList.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
word name(const complex &c)
Return string representation of complex.
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< ' ';}gmvFile<< nl;for(const word &name :lagrangianScalarNames){ IOField< scalar > fld(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
Global function forwards to reuseTmpDimensionedField::New.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Traits class for primitives.
label ListType::const_reference const label start
void size(const label n) noexcept
Override size to be inconsistent with allocated storage.
#define WarningInFunction
Report a warning using Foam::Warning.
Database for solution data, solver performance and other reduced data.