50 bool Foam::sampledSets::verbose_ =
false;
55 void Foam::sampledSets::combineSampledSets
57 PtrList<coordSet>& masterSampledSets,
65 masterSampledSets_.clear();
66 masterSampledSets_.setSize(size());
67 indexSets_.setSize(size());
69 const PtrList<sampledSet>& sampledSets = *
this;
73 const sampledSet& samplePts = sampledSets[setI];
94 gatheredPts, accessOp<List<point>>()
99 ListListOps::combine<labelList>
101 gatheredSegments, accessOp<labelList>()
106 ListListOps::combine<scalarList>
108 gatheredDist, accessOp<scalarList>()
116 <<
"Sample set " << samplePts.name()
117 <<
" has zero points." <<
endl;
121 SortableList<scalar> sortedDist(allCurveDist);
122 indexSets[setI] = sortedDist.indices();
124 masterSampledSets.set
131 List<point>(UIndirectList<point>(allPts, indexSets[setI])),
132 scalarList(UIndirectList<scalar>(allCurveDist, indexSets[setI]))
152 refCast<const fvMesh>
160 loadFromFiles_(
false),
162 searchEngine_(mesh_),
168 outputPath_ = mesh_.time().path()/
".."/
"postProcessing"/
name;
172 outputPath_ = mesh_.time().path()/
"postProcessing"/
name;
176 outputPath_ = outputPath_/mesh_.name();
190 const bool loadFromFiles
195 mesh_(refCast<const fvMesh>(obr)),
196 loadFromFiles_(loadFromFiles),
198 searchEngine_(mesh_),
204 outputPath_ = mesh_.time().path()/
".."/
"postProcessing"/
name;
208 outputPath_ = mesh_.time().path()/
"postProcessing"/
name;
212 outputPath_ = outputPath_/mesh_.name();
231 verbose_ = verbosity;
245 const label nFields = classifyFields();
251 Pout<<
"timeName = " << mesh_.time().timeName() <<
nl 252 <<
"scalarFields " << scalarFields_ <<
nl 253 <<
"vectorFields " << vectorFields_ <<
nl 254 <<
"sphTensorFields " << sphericalTensorFields_ <<
nl 255 <<
"symTensorFields " << symmTensorFields_ <<
nl 256 <<
"tensorFields " << tensorFields_ <<
nl;
263 Pout<<
"Creating directory " 264 << outputPath_/mesh_.time().timeName()
268 mkDir(outputPath_/mesh_.time().timeName());
274 sampleAndWrite(scalarFields_);
275 sampleAndWrite(vectorFields_);
276 sampleAndWrite(sphericalTensorFields_);
277 sampleAndWrite(symmTensorFields_);
278 sampleAndWrite(tensorFields_);
290 bool setsFound = dict_.
found(
"sets");
293 dict_.lookup(
"fields") >> fieldSelection_;
296 dict.
lookup(
"interpolationScheme") >> interpolationScheme_;
297 dict.
lookup(
"setFormat") >> writeFormat_;
301 dict_.lookup(
"sets"),
305 combineSampledSets(masterSampledSets_, indexSets_);
309 Info<<
"Reading set description:" <<
nl;
312 Info<<
" " << operator[](setI).name() <<
nl;
320 Pout<<
"sample fields:" << fieldSelection_ <<
nl 321 <<
"sample sets:" <<
nl <<
"(" <<
nl;
325 Pout<<
" " << operator[](setI) <<
endl;
336 bool setsFound = dict_.found(
"sets");
339 searchEngine_.correct();
343 dict_.lookup(
"sets"),
347 combineSampledSets(masterSampledSets_, indexSets_);
354 if (&mpm.
mesh() == &mesh_)
List< labelList > labelListList
A List of labelList.
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
virtual void movePoints(const polyMesh &)
Update for mesh point-motion.
A list of keyword definitions, which are a keyword followed by any number of values (e...
static const fileName null
An empty fileName.
static int myProcNo(const label communicator=0)
Number of this process (starting from masterNo() = 0)
static word defaultRegion
Return the default region name.
Ostream & endl(Ostream &os)
Add newline and flush stream.
static bool master(const label communicator=0)
Am I the master process.
virtual bool read(const dictionary &)
Read the sampledSets.
Abstract base-class for Time/database functionObjects.
const Type & lookupObject(const word &name) const
Lookup and return the object of the given Type.
AccessType combine(const List< T > &, AccessOp aop=accessOp< T >())
Combines sublists into one big list.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Macros for easy insertion into run-time selection tables.
bool read(const char *, int32_t &)
A class for handling words, derived from string.
List< scalar > scalarList
A List of scalars.
static const word null
An empty word.
void correct()
Correct for mesh changes.
virtual void updateMesh(const mapPolyMesh &)
Update for changes of mesh.
List< label > labelList
A List of labels.
virtual bool execute()
Execute, currently does nothing.
Class used for the read-construction of.
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream)
Info<< "Predicted p max-min : "<< max(p).value()<< " "<< min(p).value()<< endl;rho==max(rho0+psi *p, rhoMin);# 1 "/home/ubuntu/OpenFOAM-8/applications/solvers/multiphase/cavitatingFoam/alphavPsi.H" 1{ alphav=max(min((rho - rholSat)/(rhovSat - rholSat), scalar(1)), scalar(0));alphal=1.0 - alphav;Info<< "max-min alphav: "<< max(alphav).value()<< " "<< min(alphav).value()<< endl;psiModel-> correct()
sampledSets(const word &name, const Time &time, const dictionary &dict)
Construct from Time and dictionary.
defineTypeNameAndDebug(combustionModel, 0)
bool mkDir(const fileName &, mode_t=0777)
Make a directory and return an error if it could not be created.
void verbose(const bool verbosity=true)
Set verbosity level.
word name(const complex &)
Return a string representation of a complex.
virtual void readUpdate(const polyMesh::readUpdateState state)
Update for changes of mesh due to readUpdate.
static bool & parRun()
Is this a parallel run?
static label nProcs(const label communicator=0)
Number of processes in parallel run.
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
#define WarningInFunction
Report a warning using Foam::Warning.
prefixOSstream Pout(cout, "Pout")
virtual bool write()
Sample and write.
const polyMesh & mesh() const
Return polyMesh.
Mesh consisting of general polyhedral cells.
readUpdateState
Enumeration defining the state of the mesh after a read update.
Registry of regIOobjects.
static void gatherList(const List< commsStruct > &comms, List< T > &Values, const int tag, const label comm)
Gather data but keep individual values separate.
virtual ~sampledSets()
Destructor.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.