34 bool Foam::functionObjects::vtkWrite::updateSubset
36 fvMeshSubset& subsetter
39 if (selection_.empty())
49 subsetter.reset(selectedCells);
62 wordRes::filter patchFilter(selectPatches_, blockPatches_);
66 if (isType<emptyPolyPatch>(
pp))
70 else if (isA<processorPolyPatch>(
pp))
75 if (patchFilter(
pp.name()))
85 bool Foam::functionObjects::vtkWrite::update()
90 && (meshes_.size() == meshSubsets_.size())
91 && (meshes_.size() == vtuMappings_.size())
97 meshSubsets_.resize(meshes_.size());
98 vtuMappings_.resize(meshes_.size());
101 for (
const fvMesh&
mesh : meshes_)
103 if (meshSubsets_.set(regioni))
105 meshSubsets_[regioni].clear();
110 meshSubsets_.set(regioni,
new fvMeshSubset(
mesh));
113 if (vtuMappings_.set(regioni))
116 vtuMappings_[regioni].clear();
124 new vtk::vtuCells(writeOpts_, decompose_)
132 for (
auto& subsetter : meshSubsets_)
134 updateSubset(subsetter);
135 vtuMappings_[regioni].reset(subsetter.mesh());
146 bool Foam::functionObjects::vtkWrite::readSelection(
const dictionary&
dict)
148 meshSubsets_.clear();
149 vtuMappings_.clear();
153 selectRegions_.clear();
154 dict.readIfPresent(
"regions", selectRegions_);
156 if (selectRegions_.empty())
158 selectRegions_.resize(1);
159 selectRegions_.front() =
164 meshes_ = time_.csorted<fvMesh>(selectRegions_);
169 <<
"No mesh regions selected for function object " 173 selectPatches_.clear();
174 dict.readIfPresent(
"patches", selectPatches_);
176 blockPatches_.clear();
177 dict.readIfPresent(
"excludePatches", blockPatches_);
179 selectFields_.clear();
180 dict.readEntry(
"fields", selectFields_);
182 blockFields_.clear();
183 dict.readIfPresent(
"excludeFields", blockFields_);
186 selection_ =
dict.subOrEmptyDict(
"selection");
const labelList patchIDs(pbm.indices(polyPatchNames, true))
constexpr char nl
The newline '\n' character (0x0a)
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
static word defaultRegion
Return the default region name.
static bitSet select(const polyMesh &mesh, const dictionary &dict, const bool verbosity=false)
Return a cell selection according to the dictionary specification of actions.
virtual void updateMesh(const mapPolyMesh &mpm)
Update for changes of mesh.
#define WarningInFunction
Report a warning using Foam::Warning.
const polyBoundaryMesh & patches
Mesh consisting of general polyhedral cells.
virtual void movePoints(const polyMesh &mesh)
Update for mesh point-motion.
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())