83 Info<<
"processor" << proci << nl
84 <<
"\tMesh bounds : " << bbs[0] <<
nl;
87 Info<<
"\t " << bbs[i]<<
nl;
89 Info<<
"\tSurface bounding box : " << surfBb[proci] << nl
90 <<
"\tTriangles : " << nFaces[proci] << nl
91 <<
"\tVertices : " <<
nPoints[proci]
99 int main(
int argc,
char *argv[])
103 "redistribute a triSurface" 111 "preserve surface outside of mesh bounds" 116 runTime.functionObjects().off();
121 Info<<
"Reading surface from " << surfFileName << nl << nl
122 <<
"Using distribution method " 124 <<
" " << distType << nl <<
endl;
126 const bool keepNonMapped =
args.
options().found(
"keepNonMapped");
130 Info<<
"Preserving surface outside of mesh bounds." << nl <<
endl;
134 Info<<
"Removing surface outside of mesh bounds." << nl <<
endl;
141 <<
"Please run this program on the decomposed case." 142 <<
" It will read surface " << surfFileName
143 <<
" and decompose it such that it overlaps the mesh bounding box." 178 const fileName actualPath(io.filePath());
180 localPath.replace(runTime.rootPath() +
'/',
"");
182 if (actualPath == io.objectPath())
184 Info<<
"Loading local (decomposed) surface " << localPath << nl <<
endl;
188 Info<<
"Loading undecomposed surface " << localPath << nl <<
endl;
193 if (!
isFile(actualPath /
"Dict"))
197 dict.
add(
"distributionType", distType);
198 dict.
add(
"mergeDistance", SMALL);
215 Info<<
"Writing dummy bounds dictionary to " << ioDict.name()
218 ioDict.regIOobject::writeObject
222 ioDict.time().writeCompression()
229 Info<<
"Loaded surface" << nl <<
endl;
243 surfMesh.searchableSurface::instance(),
244 surfMesh.searchableSurface::local(),
257 fc[triI] = s[triI].centre(s.
points());
261 fcPtr.ptr()->store();
266 Info<<
"Before redistribution:" <<
endl;
271 Info<<
"Redistributing surface" << nl <<
endl;
288 Info<<
"After redistribution:" <<
endl;
292 Info<<
"Writing surface." << nl <<
endl;
293 surfMesh.searchableSurface::write();
cachedRandom rndGen(label(0),-1)
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)
bool isFile(const fileName &, const bool checkGzip=true)
Does the name exist as a FILE in the file system?
treeBoundBox extend(Random &, const scalar s) const
Return slightly wider bounding box.
Ostream & endl(Ostream &os)
Add newline and flush stream.
const Field< PointType > & points() const
Return reference to global points.
static SLList< string > validArgs
A list of valid (mandatory) arguments.
A bounding box defined in terms of the points at its extremities.
static const NamedEnum< distributionType, 3 > distributionTypeNames_
const Foam::HashTable< string > & options() const
Return options.
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.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
void clear()
Delete object (if the pointer is valid) and set pointer to NULL.
A class for handling words, derived from string.
Simple random number generator.
A surface mesh consisting of general polygon faces.
IOoject and searching on distributed triSurface. All processor hold (possibly overlapping) part of th...
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.