51 bool Foam::sampledSets::verbose_ =
false;
56 void Foam::sampledSets::combineSampledSets
58 PtrList<coordSet>& masterSampledSets,
66 masterSampledSets_.clear();
67 masterSampledSets_.setSize(size());
68 indexSets_.setSize(size());
70 const PtrList<sampledSet>& sampledSets = *
this;
74 const sampledSet& samplePts = sampledSets[setI];
95 gatheredPts, accessOp<List<point>>()
100 ListListOps::combine<labelList>
102 gatheredSegments, accessOp<labelList>()
107 ListListOps::combine<scalarList>
109 gatheredDist, accessOp<scalarList>()
117 <<
"Sample set " << samplePts.name()
118 <<
" has zero points." <<
endl;
122 SortableList<scalar> sortedDist(allCurveDist);
123 indexSets[setI] = sortedDist.indices();
125 masterSampledSets.set
132 List<point>(UIndirectList<point>(allPts, indexSets[setI])),
133 scalarList(UIndirectList<scalar>(allCurveDist, indexSets[setI]))
153 refCast<const fvMesh>
161 loadFromFiles_(
false),
163 searchEngine_(mesh_),
172 outputPath_ = outputPath_/mesh_.name();
184 const bool loadFromFiles
189 mesh_(refCast<const fvMesh>(obr)),
190 loadFromFiles_(loadFromFiles),
192 searchEngine_(mesh_),
201 outputPath_ = outputPath_/mesh_.name();
218 verbose_ = verbosity;
232 const label nFields = classifyFields();
238 Pout<<
"timeName = " << mesh_.time().timeName() <<
nl 239 <<
"scalarFields " << scalarFields_ <<
nl 240 <<
"vectorFields " << vectorFields_ <<
nl 241 <<
"sphTensorFields " << sphericalTensorFields_ <<
nl 242 <<
"symTensorFields " << symmTensorFields_ <<
nl 243 <<
"tensorFields " << tensorFields_ <<
nl;
250 Pout<<
"Creating directory " 251 << outputPath_/mesh_.time().timeName()
255 mkDir(outputPath_/mesh_.time().timeName());
261 sampleAndWrite(scalarFields_);
262 sampleAndWrite(vectorFields_);
263 sampleAndWrite(sphericalTensorFields_);
264 sampleAndWrite(symmTensorFields_);
265 sampleAndWrite(tensorFields_);
277 bool setsFound = dict_.
found(
"sets");
280 dict_.lookup(
"fields") >> fieldSelection_;
283 dict.
lookup(
"interpolationScheme") >> interpolationScheme_;
284 dict.
lookup(
"setFormat") >> writeFormat_;
288 dict_.lookup(
"sets"),
292 combineSampledSets(masterSampledSets_, indexSets_);
296 Info<<
"Reading set description:" <<
nl;
299 Info<<
" " << operator[](setI).name() <<
nl;
307 Pout<<
"sample fields:" << fieldSelection_ <<
nl 308 <<
"sample sets:" <<
nl <<
"(" <<
nl;
312 Pout<<
" " << operator[](setI) <<
endl;
323 bool setsFound = dict_.found(
"sets");
326 searchEngine_.correct();
330 dict_.lookup(
"sets"),
334 combineSampledSets(masterSampledSets_, indexSets_);
341 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 &)
static const word outputPrefix
Directory prefix.
A class for handling words, derived from string.
Info<< "Predicted p max-min : "<< max(p).value()<< " "<< min(p).value()<< endl;rho==max(rho0+psi *p, rhoMin);# 1 "/home/ubuntu/OpenFOAM-9/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()
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)
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 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.