80 Info<<
"processor" << proci << nl
81 <<
"\tMesh bounds : " << bbs[0] <<
nl;
84 Info<<
"\t " << bbs[i]<<
nl;
86 Info<<
"\tSurface bounding box : " << surfBb[proci] << nl
87 <<
"\tTriangles : " << nFaces[proci] << nl
88 <<
"\tVertices : " <<
nPoints[proci]
96 int main(
int argc,
char *argv[])
100 "redistribute a triSurface" 108 "preserve surface outside of mesh bounds" 113 runTime.functionObjects().off();
118 Info<<
"Reading surface from " << surfFileName << nl << nl
119 <<
"Using distribution method " 121 <<
" " << distType << nl <<
endl;
123 const bool keepNonMapped =
args.
options().found(
"keepNonMapped");
127 Info<<
"Preserving surface outside of mesh bounds." << nl <<
endl;
131 Info<<
"Removing surface outside of mesh bounds." << nl <<
endl;
138 <<
"Please run this program on the decomposed case." 139 <<
" It will read surface " << surfFileName
140 <<
" and decompose it such that it overlaps the mesh bounding box." 176 const fileName actualPath(typeFilePath<searchableSurface>(io));
178 localPath.replace(runTime.rootPath() +
'/',
"");
180 if (actualPath == io.objectPath())
182 Info<<
"Loading local (decomposed) surface " << localPath << nl <<
endl;
186 Info<<
"Loading undecomposed surface " << localPath << nl <<
endl;
191 if (!
isFile(actualPath /
"Dict"))
195 dict.
add(
"distributionType", distType);
196 dict.
add(
"mergeDistance", SMALL);
213 Info<<
"Writing dummy bounds dictionary to " << ioDict.name()
217 ioDict.regIOobject::writeObject
221 ioDict.time().writeCompression(),
229 Info<<
"Loaded surface" << nl <<
endl;
243 surfMesh.searchableSurface::time().timeName(),
255 fcPtr.ptr()->store();
260 Info<<
"Before redistribution:" <<
endl;
265 Info<<
"Redistributing surface" << nl <<
endl;
282 Info<<
"After redistribution:" <<
endl;
286 Info<<
"Writing surface." << nl <<
endl;
static void scatterList(const List< commsStruct > &comms, List< T > &Values, const int tag, const label comm)
Scatter data. Reverse of gatherList.
#define forAll(list, i)
Loop across all elements in list.
List< treeBoundBox > meshBb(1, treeBoundBox(boundBox(coarseMesh.points(), false)).extend(rndGen, 1e-3))
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
A class for handling file names.
errorManipArg< error, int > exit(error &err, const int errNo=1)
const double e
Elementary charge.
A list of keyword definitions, which are a keyword followed by any number of values (e...
#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...
void size(const label)
Override size to be inconsistent with allocated storage.
static int myProcNo(const label communicator=0)
Number of this process (starting from masterNo() = 0)
Ostream & endl(Ostream &os)
Add newline and flush stream.
static SLList< string > validArgs
A list of valid (mandatory) arguments.
const Field< PointType > & faceCentres() const
Return face centres for patch.
A bounding box defined in terms of the points at its extremities.
static const NamedEnum< distributionType, 3 > distributionTypeNames_
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
bool add(entry *, bool mergeEntry=false)
Add a new entry.
virtual const pointField & points() const
Return raw points.
localIOdictionary is derived from IOdictionary but excludes parallel master reading.
void clear()
Delete object (if the pointer is valid) and set pointer to.
const Foam::HashTable< string > & options() const
Return options.
A class for handling words, derived from string.
cachedRandom rndGen(label(0), -1)
const Field< PointType > & points() const
Return reference to global points.
Simple random number generator.
A surface mesh consisting of general polygon faces.
bool isFile(const fileName &, const bool checkGzip=true, const bool followLink=true)
Does the name exist as a FILE in the file system?
IOoject and searching on distributed triSurface. All processor hold (possibly overlapping) part of th...
treeBoundBox extend(Random &, const scalar s) const
Return slightly wider bounding box.
static bool & parRun()
Is this a parallel run?
static label nProcs(const label communicator=0)
Number of processes in parallel run.
static const versionNumber currentVersion
Current version number.
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Standard boundBox + extra functionality for use in octree.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
static void addBoolOption(const word &opt, const string &usage="")
Add to a bool option to validOptions with usage information.
static void addNote(const string &)
Add extra notes for the usage information.
Triangulated surface description with patch information.
Foam::argList args(argc, argv)
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
static void gatherList(const List< commsStruct > &comms, List< T > &Values, const int tag, const label comm)
Gather data but keep individual values separate.