62 int main(
int argc,
char *argv[])
75 "Restrict cells to refine to those in specified cellSet"
97 <<
"Cannot find any patches in set " <<
patches <<
endl
102 label nPatchFaces = 0;
103 label nPatchEdges = 0;
124 forAll(meshPoints, pointi)
126 const label meshPointi = meshPoints[pointi];
132 cutCells.insert(pCells[pCelli]);
140 Info<<
"Restrict cells to refine to those in cellSet "
145 Info<<
" Read " << cellsToRefine.size()
146 <<
" cells from cellSet " << cellsToRefine.relativeObjectPath()
151 if (!cellsToRefine.found(iter.key()))
153 cutCells.erase(iter);
166 forAll(meshPoints, pointi)
168 vertOnPatch[meshPoints[pointi]] =
true;
177 forAll(meshPoints, pointi)
179 const label meshPointi = meshPoints[pointi];
185 const label edgeI = pEdges[pEdgeI];
188 label otherPointi =
e.otherVertex(meshPointi);
190 if (!vertOnPatch[otherPointi])
192 allCutEdges.append(edgeI);
194 if (
e.start() == meshPointi)
196 allCutEdgeWeights.append(weight);
200 allCutEdgeWeights.append(1 - weight);
207 allCutEdges.shrink();
208 allCutEdgeWeights.shrink();
211 <<
" cells:" << cutCells.size() <<
nl
212 <<
" edges:" << allCutEdges.size() <<
endl;
216 cutEdgeWeights.
transfer(allCutEdgeWeights);
217 allCutEdgeWeights.clear();
236 cutter.setRefinement(cuts, meshMod);
246 cutter.topoChange(map());
256 Info<<
"Writing refined mesh to time " << runTime.name() <<
endl;
#define forAll(list, i)
Loop across all elements in list.
#define forAllIter(Container, container, iter)
Iterate across all elements in the container object of type.
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
Input from memory buffer stream.
void transfer(List< T > &)
Transfer the contents of the argument List into this list.
const labelList & meshPoints() const
Return labelList of mesh points in patch. They are constructed.
label size() const
Return the number of elements in the UPtrList.
static void addOption(const word &opt, const string ¶m="", const string &usage="")
Add to an option to validOptions with usage information.
bool optionReadIfPresent(const word &opt, T &) const
Read a value from the named option if present.
static void noParallel()
Remove the parallel options.
static SLList< string > validArgs
A list of valid (mandatory) arguments.
T argRead(const label index) const
Read a value from the argument at index.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Description of cuts across cells.
A collection of cell labels.
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
virtual bool write(const bool write=true) const
Write mesh using IO settings from time.
wordList toc(const word &className) const
Return the list of names of IOobjects of given class name.
labelHashSet patchSet(const UList< wordRe > &patchNames, const bool warnNotFound=true, const bool usePatchGroups=true) const
Return the patch set corresponding to the given names.
wordList names() const
Return the list of patch names.
static word defaultRegion
Return the default region name.
const fileName & pointsInstance() const
Return the current instance directory for points.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
void setInstance(const fileName &)
Set the instance for mesh files.
A patch is a list of labels that address the faces in the global face list.
Direct mesh changes based on v1.3 polyTopoChange syntax.
const labelListList & pointEdges() const
const edgeList & edges() const
Return mesh edges. Uses calcEdges.
const labelListList & pointCells() const
A class for handling words, derived from string.
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
int main(int argc, char *argv[])
const fvPatchList & patches
errorManipArg< error, int > exit(error &err, const int errNo=1)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Foam::argList args(argc, argv)