34 bool Foam::functionObjects::vtkWrite::updateSubset
36 fvMeshSubset& subsetter
39 if (selection_.empty())
49 subsetter.reset(selectedCells);
60 DynamicList<label> patchIDs(
patches.size());
62 wordRes::filter patchFilter(selectPatches_, blockPatches_);
64 for (
const polyPatch& pp :
patches)
66 if (isType<emptyPolyPatch>(pp))
70 else if (isA<processorPolyPatch>(pp))
75 if (patchFilter(pp.name()))
77 patchIDs.append(pp.index());
81 return patchIDs.shrink();
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 word&
regionName : meshes_.sortedToc())
105 if (meshSubsets_.set(regioni))
107 meshSubsets_[regioni].clear();
112 meshSubsets_.set(regioni,
new fvMeshSubset(
mesh));
115 if (vtuMappings_.set(regioni))
118 vtuMappings_[regioni].clear();
126 new vtk::vtuCells(writeOpts_, decompose_)
134 for (
auto& subsetter : meshSubsets_)
136 updateSubset(subsetter);
137 vtuMappings_[regioni].reset(subsetter.mesh());
148 bool Foam::functionObjects::vtkWrite::readSelection(
const dictionary&
dict)
150 meshSubsets_.clear();
151 vtuMappings_.clear();
155 meshes_ = time_.lookupClass<fvMesh>();
157 selectRegions_.clear();
158 dict.readIfPresent(
"regions", selectRegions_);
160 if (selectRegions_.empty())
162 selectRegions_.resize(1);
163 selectRegions_.first() =
168 meshes_.filterKeys(selectRegions_);
173 <<
"No mesh regions selected for function object " <<
name()
177 selectPatches_.clear();
178 dict.readIfPresent(
"patches", selectPatches_);
180 blockPatches_.clear();
181 dict.readIfPresent(
"excludePatches", blockPatches_);
183 selectFields_.clear();
184 dict.readEntry(
"fields", selectFields_);
186 blockFields_.clear();
187 dict.readIfPresent(
"excludeFields", blockFields_);
190 selection_ =
dict.subOrEmptyDict(
"selection");
constexpr char nl
The newline '\n' character (0x0a)
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Foam::word regionName(Foam::polyMesh::defaultRegion)
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for 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.