37void Foam::sampledSurfaces::writeSurface
40 const Field<Type>& values,
58template<
class Type,
class GeoMeshType>
59void Foam::sampledSurfaces::storeRegistryField
62 const word& fieldName,
67 s.storeRegistryField<Type, GeoMeshType>
79void Foam::sampledSurfaces::performAction
91 const word& fieldName =
fld.name();
98 if (!hasFaces_[surfi])
continue;
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)
158void Foam::sampledSurfaces::performAction
164 const word& fieldName =
fld.name();
171 if (!hasFaces_[surfi])
continue;
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)
193template<
class GeoField>
194void Foam::sampledSurfaces::performAction
203 fieldNames = objects.sortedNames<GeoField>(fieldSelection_);
207 fieldNames = mesh_.thisDb().sortedNames<GeoField>(fieldSelection_);
210 for (
const word& fieldName : fieldNames)
214 Info<<
"sampleWrite: " << fieldName <<
endl;
237 tfield.cref(mesh_.thisDb().cfindObject<GeoField>(fieldName));
242 performAction(tfield(), request);
248template<
class Container,
class Predicate>
249bool Foam::sampledSurfaces::testAny
251 const Container& items,
252 const Predicate& pred
255 for (
const auto& item : items)
IOdictionary propsDict(dictIO)
Info<< nl;Info<< "Write faMesh in vtk format:"<< nl;{ vtk::uindirectPatchWriter writer(aMesh.patch(), fileName(aMesh.time().globalPath()/vtkBaseFileName));writer.writeGeometry();globalIndex procAddr(aMesh.nFaces());labelList cellIDs;if(UPstream::master()) { cellIDs.resize(procAddr.totalSize());for(const labelRange &range :procAddr.ranges()) { auto slice=cellIDs.slice(range);slice=identity(range);} } writer.beginCellData(4);writer.writeProcIDs();writer.write("cellID", cellIDs);writer.write("area", aMesh.S().field());writer.write("normal", aMesh.faceAreaNormals());writer.beginPointData(1);writer.write("normal", aMesh.pointAreaNormals());Info<< " "<< writer.output().name()<< nl;}{ vtk::lineWriter writer(aMesh.points(), aMesh.edges(), fileName(aMesh.time().globalPath()/(vtkBaseFileName+"-edges")));writer.writeGeometry();writer.beginCellData(4);writer.writeProcIDs();{ Field< scalar > fld(faMeshTools::flattenEdgeField(aMesh.magLe(), true))
vtk::lineWriter writer(edgeCentres, edgeList::null(), fileName(aMesh.time().globalPath()/(vtkBaseFileName+"-edgesCentres")))
Generic templated field type that is much like a Foam::List except that it is expected to hold numeri...
List of IOobjects with searching and retrieving facilities. Implemented as a HashTable,...
@ NO_REGISTER
Do not request registration (bool: false).
@ MUST_READ
Reading required.
@ NO_WRITE
Ignore writing from objectRegistry::writeObject().
Defines the attributes of an object for which implicit objectRegistry management is supported,...
static word groupName(StringType base, const word &group)
Create dot-delimited name.group string.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Dimension set for the base types, which can be used to implement rigorous dimension checking for alge...
void setProperty(const word &entryName, const Type &value)
Add generic property.
const Time & time_
Reference to the time database.
static autoPtr< interpolation< Type > > New(const word &interpolationType, const GeometricField< Type, fvPatchField, volMesh > &psi)
Return a reference to the specified interpolation scheme.
A class for managing references or pointers (no reference counting).
An abstract class for surfaces with sampling.
A class for handling words, derived from Foam::string.
word outputName("finiteArea-edges.obj")
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))
List< T > values(const HashTable< T, Key, Hash > &tbl, const bool doSort=false)
List of values from HashTable, optionally sorted.
List< word > wordList
List of word.
GeometricField< Type, fvPatchField, volMesh > VolumeField
A volume field for a given type.
messageStream Info
Information stream (stdout output on master, null elsewhere).
Ostream & endl(Ostream &os)
Add newline and flush stream.
GeometricField< Type, fvsPatchField, surfaceMesh > SurfaceField
A (volume) surface field for a given type.
Fields (face and point) for polySurface.
#define forAll(list, i)
Loop across all elements in list.