58 int main(
int argc,
char *argv[])
69 "restrict cells to refine based on specified cellSet name" 75 runTime.functionObjects().off();
90 <<
"Cannot find any patches in set " <<
patches << endl
95 label nPatchFaces = 0;
96 label nPatchEdges = 0;
117 forAll(meshPoints, pointi)
119 label meshPointi = meshPoints[pointi];
125 cutCells.insert(pCells[pCelli]);
134 Info<<
"Subsetting cells to cut based on cellSet" 145 cutCells.erase(iter.key());
147 Info<<
"Removed from cells to cut all the ones not in set " 159 forAll(meshPoints, pointi)
161 vertOnPatch[meshPoints[pointi]] =
true;
170 forAll(meshPoints, pointi)
172 label meshPointi = meshPoints[pointi];
178 const label edgeI = pEdges[pEdgeI];
183 if (!vertOnPatch[otherPointi])
185 allCutEdges.append(edgeI);
187 if (e.
start() == meshPointi)
189 allCutEdgeWeights.append(weight);
193 allCutEdgeWeights.append(1 - weight);
200 allCutEdges.shrink();
201 allCutEdgeWeights.shrink();
204 <<
" cells:" << cutCells.size() <<
nl 205 <<
" edges:" << allCutEdges.size() <<
endl;
209 cutEdgeWeights.
transfer(allCutEdgeWeights);
210 allCutEdgeWeights.clear();
229 cutter.setRefinement(cuts, meshMod);
238 if (morphMap().hasMotionPoints())
244 cutter.updateMesh(morphMap());
254 Info<<
"Writing refined mesh to time " << runTime.timeName() <<
endl;
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
errorManipArg< error, int > exit(error &err, const int errNo=1)
wordList names() const
Return a list of patch names.
const labelList & meshPoints() const
Return labelList of mesh points in patch. They are constructed.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
const edgeList & edges() const
Return mesh edges. Uses calcEdges.
void size(const label)
Override size to be inconsistent with allocated storage.
bool optionReadIfPresent(const word &opt, T &) const
Read a value from the named option if present.
Ostream & endl(Ostream &os)
Add newline and flush stream.
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.
Description of cuts across cells.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
const labelListList & pointCells() const
bool optionFound(const word &opt) const
Return true if the named option is found.
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.
static void addOption(const word &opt, const string ¶m="", const string &usage="")
Add to an option to validOptions with usage information.
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.
List< label > labelList
A List of labels.
const labelListList & pointEdges() const
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
List< Key > toc() const
Return the table of contents.
label start() const
Return start vertex label.
T argRead(const label index) const
Read a value from the argument at index.
void setInstance(const fileName &)
Set the instance for mesh files.
virtual tmp< scalarField > movePoints(const pointField &)
Move points, returns volumes swept by faces in motion.
const fileName & pointsInstance() const
Return the current instance directory for points.
Input from memory buffer stream.
A collection of cell labels.
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...
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.
virtual bool write() const
Write mesh using IO settings from time.
label size() const
Return the number of elements in the UPtrList.