62 int main(
int argc,
char *argv[])
74 "Restrict cells to refine to those in specified cellSet" 79 runTime.functionObjects().off();
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];
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);
245 if (map().hasMotionPoints())
251 cutter.topoChange(map());
261 Info<<
"Writing refined mesh to time " << runTime.timeName() <<
endl;
const fvPatchList & patches
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
#define forAll(list, i)
Loop across all elements in list.
errorManipArg< error, int > exit(error &err, const int errNo=1)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
const labelListList & pointEdges() const
#define forAllIter(Container, container, iter)
Iterate across all elements in the container object of type.
static word defaultRegion
Return the default region name.
Ostream & endl(Ostream &os)
Add newline and flush stream.
bool optionFound(const word &opt) const
Return true if the named option is found.
static void noParallel()
Remove the parallel options.
static SLList< string > validArgs
A list of valid (mandatory) arguments.
label otherVertex(const label a) const
Given one vertex, return the other.
virtual bool write(const bool write=true) const
Write mesh using IO settings from time.
Description of cuts across cells.
labelHashSet patchSet(const UList< wordRe > &patchNames, const bool warnNotFound=true, const bool usePatchGroups=true) const
Return the set of patch IDs corresponding to the given names.
bool optionReadIfPresent(const word &opt, T &) const
Read a value from the named option if present.
const labelList & meshPoints() const
Return labelList of mesh points in patch. They are constructed.
const fileName & pointsInstance() const
Return the current instance directory for points.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects...
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
A class for handling words, derived from string.
wordList names() const
Return a list of patch names.
static void addOption(const word &opt, const string ¶m="", const string &usage="")
Add to an option to validOptions with usage information.
List< label > labelList
A List of labels.
virtual void setPoints(const pointField &)
Reset the points.
const labelListList & pointCells() const
void setInstance(const fileName &)
Set the instance for mesh files.
label size() const
Return the number of elements in the UPtrList.
const edgeList & edges() const
Return mesh edges. Uses calcEdges.
Input from memory buffer stream.
A collection of cell labels.
T argRead(const label index) const
Read a value from the argument at index.
Direct mesh changes based on v1.3 polyTopoChange syntax.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
List< Key > toc() const
Return the table of contents.
A patch is a list of labels that address the faces in the global face list.
Foam::argList args(argc, argv)
void transfer(List< T > &)
Transfer the contents of the argument List into this list.
label start() const
Return start vertex label.