Go to the documentation of this file.
65 int main(
int argc,
char *argv[])
69 "Refine cells next to specified patches."
76 "The list of patch names or regex - Eg, '(top \"Wall.\")'"
81 "The size of the refined cells as a fraction of the edge-length"
82 " on a (0,1) interval"
89 "Restrict cells to refine based on specified cellSet name"
102 const scalar weight =
args.
get<scalar>(2);
103 const bool overwrite =
args.
found(
"overwrite");
106 if (!patchSet.size())
109 <<
"Cannot find any patches in set " <<
patches <<
endl
114 label nPatchFaces = 0;
115 label nPatchEdges = 0;
117 for (
const label patchi : patchSet)
131 for (
const label patchi : patchSet)
136 for (
const label meshPointi : meshPoints)
140 cutCells.insert(pCells);
148 Info<<
"Subsetting cells to cut based on cellSet"
153 Info<<
"Read " <<
cells.size() <<
" cells from cellSet "
158 cutCells.retain(
cells);
160 Info<<
"Removed from cells to cut all the ones not in set "
167 for (
const label patchi : patchSet)
172 vertOnPatch.
set(meshPoints);
175 for (
const label patchi : patchSet)
180 for (
const label meshPointi : meshPoints)
184 for (
const label edgei : pEdges)
188 label otherPointi =
e.otherVertex(meshPointi);
190 if (!vertOnPatch.test(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 (morphMap().hasMotionPoints())
251 cutter.updateMesh(morphMap());
A class for handling words, derived from Foam::string.
virtual bool write(const bool valid=true) const
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
static word timeName(const scalar t, const int precision=precision_)
Direct mesh changes based on v1.3 polyTopoChange syntax.
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
static void addNote(const string ¬e)
virtual tmp< scalarField > movePoints(const pointField &)
const polyBoundaryMesh & boundaryMesh() const
Ostream & endl(Ostream &os)
const edgeList & edges() const
const labelListList & pointEdges() const
A HashTable with keys but without contents that is similar to std::unordered_set.
T get(const label index) const
bool readIfPresent(const word &optName, T &val) const
A wordRe is a Foam::word, but can contain a regular expression for matching words or strings.
label nPoints() const noexcept
static void addArgument(const string &argName, const string &usage="")
const fileName & pointsInstance() const
static void noFunctionObjects(bool addWithOption=false)
Generic templated field type.
A patch is a list of labels that address the faces in the global face list.
A collection of cell labels.
errorManipArg< error, int > exit(error &err, const int errNo=1)
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
#define FatalErrorInFunction
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
static void removeFiles(const polyMesh &mesh)
const dimensionedScalar e
A List of wordRe with additional matching capabilities.
labelHashSet patchSet(const UList< wordRe > &patchNames, const bool warnNotFound=true, const bool useGroups=true) const
const labelListList & pointCells() const
const polyBoundaryMesh & patches
List< T > getList(const label index) const
std::enable_if< std::is_same< bool, TypeT >::value, bool >::type set(const label i, bool val=true)
const labelList & meshPoints() const
static void addOption(const word &optName, const string ¶m="", const string &usage="", bool advanced=false)
Foam::argList args(argc, argv)
static void removeFiles(const polyMesh &)
void setInstance(const fileName &instance, const IOobject::writeOption wOpt=IOobject::AUTO_WRITE)
bool found(const word &optName) const
Description of cuts across cells.