34bool Foam::functionObjects::vtkWrite::updateSubset
36 fvMeshSubset& subsetter
39 if (selection_.empty())
49 subsetter.reset(selectedCells);
60 DynamicList<label> patchIDs(
patches.size());
62 for (
const polyPatch& pp :
patches)
64 if (isType<emptyPolyPatch>(pp))
68 else if (isA<processorPolyPatch>(pp))
76 ? selectPatches_.match(pp.name())
80 patchIDs.append(pp.index());
84 return patchIDs.shrink();
88bool Foam::functionObjects::vtkWrite::update()
93 && (meshes_.size() == meshSubsets_.size())
94 && (meshes_.size() == vtuMappings_.size())
100 meshSubsets_.resize(meshes_.size());
101 vtuMappings_.resize(meshes_.size());
104 for (
const word&
regionName : meshes_.sortedToc())
108 if (meshSubsets_.set(regioni))
110 meshSubsets_[regioni].clear();
115 meshSubsets_.set(regioni,
new fvMeshSubset(
mesh));
118 if (vtuMappings_.set(regioni))
121 vtuMappings_[regioni].clear();
129 new vtk::vtuCells(writeOpts_, decompose_)
137 for (
auto& subsetter : meshSubsets_)
139 updateSubset(subsetter);
140 vtuMappings_[regioni].reset(subsetter.mesh());
151bool Foam::functionObjects::vtkWrite::readSelection(
const dictionary&
dict)
153 meshSubsets_.clear();
154 vtuMappings_.clear();
158 meshes_ = time_.lookupClass<fvMesh>();
160 selectRegions_.clear();
161 dict.readIfPresent(
"regions", selectRegions_);
163 if (selectRegions_.empty())
165 selectRegions_.resize(1);
166 selectRegions_.first() =
171 meshes_.filterKeys(selectRegions_);
176 <<
"No mesh regions selected for function object " <<
name()
180 selectPatches_.clear();
181 dict.readIfPresent(
"patches", selectPatches_);
183 selectFields_.clear();
184 dict.readEntry(
"fields", selectFields_);
185 selectFields_.uniq();
188 selection_ =
dict.subOrEmptyDict(
"selection");
static bitSet select(const polyMesh &mesh, const dictionary &dict, const bool verbosity=false)
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
void movePoints()
Update for new mesh geometry.
void updateMesh()
Update for new mesh topology.
Mesh consisting of general polyhedral cells.
static word defaultRegion
Return the default region name.
const polyBoundaryMesh & patches
Foam::word regionName(Foam::polyMesh::defaultRegion)
#define WarningInFunction
Report a warning using Foam::Warning.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
constexpr char nl
The newline '\n' character (0x0a)