45 const dictionary& initialPointsDict,
48 const conformationSurfaces& geometryToConformTo,
49 const cellShapeControl& cellShapeControls,
50 const autoPtr<backgroundMeshDecomposition>& decomposition
63 pointFileName_(detailsDict().
get<fileName>(
"pointFile").
expand()),
64 insideOutsideCheck_(detailsDict().
get<Switch>(
"insideOutsideCheck")),
65 randomiseInitialGrid_(detailsDict().
get<Switch>(
"randomiseInitialGrid")),
66 randomPerturbationCoeff_
68 detailsDict().
get<scalar>(
"randomPerturbationCoeff")
71 Info<<
" Inside/Outside check is " << insideOutsideCheck_.c_str()
85 pointFileName_.name(),
92 Info<<
" Inserting points from file " << pointFileName_ <<
endl;
103 <<
"Point file contain no points" 112 decomposition().distributePoints(
points);
123 pointFileName_.name(),
124 time().caseConstant(),
134 <<
"Point file contain no points" 149 bool foundAlready =
false;
157 allProcPt[proci][ptI] =
false;
159 else if (allProcPt[proci][ptI])
173 <<
"Cannot find points file " << pointsIO.objectPath()
180 if (insideOutsideCheck_)
185 minimumSurfaceDistanceCoeffSqr_
186 *
sqr(cellShapeControls().cellSize(
points))
190 DynamicList<Vb::Point> initialPoints(
insidePoints.size()/10);
198 if (randomiseInitialGrid_)
201 randomPerturbationCoeff_
204 randomPerturbationCoeff_
207 randomPerturbationCoeff_
215 initialPoints.shrink();
217 label nPointsRejected =
points.
size() - initialPoints.size();
221 reduce(nPointsRejected, sumOp<label>());
226 Info<<
" " << nPointsRejected <<
" points rejected from " 227 << pointFileName_.name() <<
endl;
230 return initialPoints;
List< ReturnType > get(const UPtrList< T > &list, const AccessOp &aop)
List of values generated by applying the access operation to each list item.
virtual List< Vb::Point > initialPoints() const
Return the initial points for the conformalVoronoiMesh.
void size(const label n)
Older name for setAddressableSize.
errorManipArg< error, int > exit(error &err, const int errNo=1)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
vectorIOField pointIOField
pointIOField is a vectorIOField.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
dimensionedSymmTensor sqr(const dimensionedVector &dv)
bool empty() const noexcept
True if List is empty (ie, size() is zero)
Ostream & endl(Ostream &os)
Add newline and flush stream.
static bool & parRun() noexcept
Test if this a parallel run.
Ignore writing from objectRegistry::writeObject()
static int myProcNo(const label communicator=worldComm)
Rank of this process in the communicator (starting from masterNo()). Can be negative if the process i...
void inplaceSubset(const BoolListType &select, ListType &input, const bool invert=false)
Inplace extract elements of the input list when select is true.
Macros for easy insertion into run-time selection tables.
#define forAll(list, i)
Loop across all elements in list.
static void allGatherList(List< T > &values, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Gather data, but keep individual values separate. Uses linear/tree communication. ...
pointFile(const dictionary &initialPointsDict, const Time &runTime, Random &rndGen, const conformationSurfaces &geometryToConformTo, const cellShapeControl &cellShapeControls, const autoPtr< backgroundMeshDecomposition > &decomposition)
Construct from components.
static label nProcs(const label communicator=worldComm)
Number of ranks in parallel run (for given communicator). It is 1 for serial run. ...
vectorField pointField
pointField is a vectorField.
Type sample01()
Return a sample whose components lie in the range [0,1].
defineTypeNameAndDebug(combustionModel, 0)
vector point
Point is a vector.
void reduce(const List< UPstream::commsStruct > &comms, T &value, const BinaryOp &bop, const int tag, const label comm)
Reduce inplace (cf. MPI Allreduce) using specified communication schedule.
messageStream Info
Information stream (stdout output on master, null elsewhere)
List< bool > boolList
A List of bools.
addToRunTimeSelectionTable(functionObject, pointHistory, dictionary)
string expand(const std::string &s, const HashTable< string > &mapping, const char sigil='$')
Expand occurrences of variables according to the mapping and return the expanded string.