67 UPstream::listGatherValues<treeBoundBox>(
treeBoundBox(
s.points()))
70 labelList nFaces(UPstream::listGatherValues<label>(
s.size()));
76 Info<<
"processor" << proci <<
nl;
83 Info<<
"\tMesh bounds : ";
91 Info<<
"\tSurface bounding box : " << surfBb[proci] <<
nl 92 <<
"\tTriangles : " << nFaces[proci] <<
nl 93 <<
"\tVertices : " <<
nPoints[proci]
102 int main(
int argc,
char *argv[])
106 "Redistribute a triSurface." 107 " The specified surface must be located in the constant/triSurface" 116 "Preserve surface outside of mesh bounds" 125 const label distType =
128 Info<<
"Reading surface from " << surfFileName <<
nl <<
nl 129 <<
"Using distribution method " 130 << distTypeName <<
nl <<
endl;
132 const bool keepNonMapped =
args.
found(
"keepNonMapped");
136 Info<<
"Preserving surface outside of mesh bounds." <<
nl <<
endl;
140 Info<<
"Removing surface outside of mesh bounds." <<
nl <<
endl;
147 <<
"Please run this program on the decomposed case." 148 <<
" It will read surface " << surfFileName
149 <<
" and decompose it such that it overlaps the mesh bounding box." 223 Info<<
"Loading local (decomposed) surface " << localPath <<
nl <<
endl;
228 Info<<
"Loading undecomposed surface " << localPath
229 <<
" on master only" <<
endl;
248 dict.
add(
"distributionType", distTypeName);
249 dict.
add(
"mergeDistance", SMALL);
265 Info<<
"Before redistribution:" <<
endl;
270 Info<<
"Redistributing surface" <<
nl <<
endl;
287 Info<<
"After redistribution:" <<
endl;
static const Enum< distributionType > distributionTypeNames_
static void addNote(const string ¬e)
Add extra notes for the usage information.
static const treeBoundBox & null() noexcept
The null treeBoundBox is the same as an inverted box.
A class for handling file names.
errorManipArg< error, int > exit(error &err, const int errNo=1)
void off()
Switch the function objects off.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
A list of keyword definitions, which are a keyword followed by a number of values (eg...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
constexpr char nl
The newline '\n' character (0x0a)
Ostream & endl(Ostream &os)
Add newline and flush stream.
static bool & parRun() noexcept
Test if this a parallel run.
void clear() noexcept
Same as reset(nullptr)
static void addBoolOption(const word &optName, const string &usage="", bool advanced=false)
Add a bool option to validOptions with usage information.
bool store()
Register object with its registry and transfer ownership to the registry.
const fileName & rootPath() const noexcept
Return the rootPath.
entry * add(entry *entryPtr, bool mergeEntry=false)
Add a new entry.
static const boundBox greatBox
A large boundBox: min/max == -/+ ROOTVGREAT.
Base class of (analytical or triangulated) surface. Encapsulates all the search routines. WIP.
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...
T getOrDefault(const word &optName, const T &deflt) const
Get a value from the named option if present, or return default.
fileName objectPath() const
The complete path + object name.
fileName typeFilePath(const bool search=true) const
Call localFilePath or globalFilePath for given type depending on its is_globalIOobject trait...
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
static void broadcast(Type &value, const label comm=UPstream::worldComm)
Broadcast content (contiguous or non-contiguous) to all communicator ranks. Does nothing in non-paral...
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
virtual const pointField & points() const
Return raw points.
#define forAll(list, i)
Loop across all elements in list.
IOoject and searching on triSurface.
void reset(T *p=nullptr) noexcept
Delete managed object and set to new given pointer.
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. ...
static label nProcs(const label communicator=worldComm)
Number of ranks in parallel run (for given communicator). It is 1 for serial run. ...
const dimensionedScalar e
Elementary charge.
const functionObjectList & functionObjects() const noexcept
Return the list of function objects.
A class for handling words, derived from Foam::string.
const word & system() const noexcept
Return system name.
A surface mesh consisting of general polygon faces that has IO capabilities and a registry for storin...
IOoject and searching on distributed triSurface. All processor hold (possibly overlapping) part of th...
const word & constant() const noexcept
Return constant name.
static const word canonicalName
The canonical name ("decomposeParDict") under which the MeshObject is registered. ...
virtual void rename(const word &newName)
Rename.
T get(const label index) const
Get a value from the argument at index.
static bool master(const label communicator=worldComm)
True if process corresponds to the master rank in the communicator.
Automatically write from objectRegistry::writeObject()
static void addArgument(const string &argName, const string &usage="")
Append a (mandatory) argument to validArgs.
Standard boundBox with extra functionality for use in octree.
messageStream Info
Information stream (stdout output on master, null elsewhere)
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, IOobject::NO_REGISTER)
Triangulated surface description with patch information.
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))
Foam::argList args(argc, argv)
Defines the attributes of an object for which implicit objectRegistry management is supported...
Request registration (bool: true)
List< treeBoundBox > meshBb(1, treeBoundBox(coarseMesh.points()).extend(rndGen, 1e-3))
bool found(const word &optName) const
Return true if the named option is found.
static IOobject selectIO(const IOobject &io, const fileName &altFile, const word &ioName="")
Return the IOobject, but also consider an alternative file name.