37 void Foam::sampledSurfaces::writeSurface
58 template<
class Type,
class GeoMeshType>
59 void Foam::sampledSurfaces::storeRegistryField
61 const sampledSurface&
s,
62 const word& fieldName,
63 const dimensionSet& dims,
67 s.storeRegistryField<Type, GeoMeshType>
79 void Foam::sampledSurfaces::performAction
81 const VolumeField<Type>&
fld,
86 autoPtr<interpolation<Type>> samplePtr;
89 autoPtr<interpolation<Type>> interpPtr;
91 const word& fieldName =
fld.name();
93 const dimensionSet& dims =
fld.dimensions();
98 if (!hasFaces_[surfi])
continue;
100 const sampledSurface&
s = operator[](surfi);
115 values =
s.interpolate(*interpPtr);
131 if ((request & actions_[surfi]) & ACTION_WRITE)
133 writeSurface<Type>(writers_[surfi],
values, fieldName);
136 if ((request & actions_[surfi]) & ACTION_STORE)
140 storeRegistryField<Type, polySurfacePointGeoMesh>
142 s, fieldName, dims, std::move(
values)
147 storeRegistryField<Type, polySurfaceGeoMesh>
149 s, fieldName, dims, std::move(
values)
158 void Foam::sampledSurfaces::performAction
160 const SurfaceField<Type>&
fld,
164 const word& fieldName =
fld.name();
166 const dimensionSet& dims =
fld.dimensions();
171 if (!hasFaces_[surfi])
continue;
173 const sampledSurface&
s = (*this)[surfi];
177 if ((request & actions_[surfi]) & ACTION_WRITE)
179 writeSurface<Type>(writers_[surfi],
values, fieldName);
182 if ((request & actions_[surfi]) & ACTION_STORE)
184 storeRegistryField<Type, polySurfaceGeoMesh>
186 s, fieldName, dims, std::move(
values)
193 template<
class GeoField>
194 void Foam::sampledSurfaces::performAction
196 const IOobjectList& objects,
203 fieldNames = objects.sortedNames<GeoField>(fieldSelection_);
207 fieldNames = mesh_.thisDb().sortedNames<GeoField>(fieldSelection_);
210 for (
const word& fieldName : fieldNames)
214 Info<<
"sampleWrite: " << fieldName <<
endl;
217 refPtr<GeoField> tfield;
237 tfield.cref(mesh_.thisDb().cfindObject<GeoField>(fieldName));
242 performAction(tfield(), request);
248 template<
class Container,
class Predicate>
249 bool Foam::sampledSurfaces::testAny
251 const Container& items,
252 const Predicate& pred
255 for (
const auto& item : items)
vtk::lineWriter writer(edgeCentres, edgeList::null(), fileName(aMesh.time().globalPath()/"finiteArea-edgesCentres"))
static autoPtr< interpolation< Type > > New(const word &interpolationType, const GeometricField< Type, fvPatchField, volMesh > &psi)
Return a reference to the specified interpolation scheme.
Fields (face and point) for polySurface.
Ostream & endl(Ostream &os)
Add newline and flush stream.
fileName relativePath(const fileName &input, const bool caseTag=false) const
Return the input relative to the globalPath by stripping off a leading value of the globalPath...
Ignore writing from objectRegistry::writeObject()
IOdictionary propsDict(dictIO)
#define forAll(list, i)
Loop across all elements in list.
List< T > values(const HashTable< T, Key, Hash > &tbl, const bool doSort=false)
List of values from HashTable, optionally sorted.
static word groupName(StringType base, const word &group)
Create dot-delimited name.group string.
word outputName("finiteArea-edges.obj")
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
void setProperty(const word &entryName, const Type &value)
Add generic property.
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))
List< word > wordList
List of word.
messageStream Info
Information stream (stdout output on master, null elsewhere)
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;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
Do not request registration (bool: false)
const Time & time_
Reference to the time database.