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());
List< label > labelList
A List of labels.
A class for handling words, derived from Foam::string.
virtual bool write(const bool valid=true) const
Write mesh using IO settings from time.
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
List< Key > toc() const
The table of contents (the keys) in unsorted order.
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)
Add extra notes for the usage information.
virtual tmp< scalarField > movePoints(const pointField &)
Move points, returns volumes swept by faces in motion.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
Ostream & endl(Ostream &os)
Add newline and flush stream.
const edgeList & edges() const
Return mesh edges. Uses calcEdges.
const labelListList & pointEdges() const
T get(const label index) const
Get a value from the argument at index.
bool readIfPresent(const word &optName, T &val) const
Read a value from the named option if present.
A wordRe is a Foam::word, but can contain a regular expression for matching words or strings.
wordList names() const
Return a list of patch names.
static void addArgument(const string &argName, const string &usage="")
Append a (mandatory) argument to validArgs.
const fileName & pointsInstance() const
Return the current instance directory for points.
static void noFunctionObjects(bool addWithOption=false)
Remove '-noFunctionObjects' option and ignore any occurrences.
messageStream Info
Information stream (uses stdout - output is on the master only)
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
Report an error message using Foam::FatalError.
static void removeFiles(const polyMesh &mesh)
Helper: remove all procAddressing files from mesh instance.
const dimensionedScalar e
Elementary charge.
label nPoints() const
Number of mesh points.
A List of wordRe with additional matching capabilities.
labelHashSet patchSet(const UList< wordRe > &patchNames, const bool warnNotFound=true, const bool useGroups=true) const
Return the set of patch IDs corresponding to the given names.
const labelListList & pointCells() const
const polyBoundaryMesh & patches
List< T > getList(const label index) const
Get a List of values from the argument at index.
std::enable_if< std::is_same< bool, TypeT >::value, bool >::type set(const label i, bool val=true)
A bitSet::set() method for a list of bool.
const labelList & meshPoints() const
Return labelList of mesh points in patch.
static void addOption(const word &optName, const string ¶m="", const string &usage="", bool advanced=false)
Add an option to validOptions with usage information.
Foam::argList args(argc, argv)
static void removeFiles(const polyMesh &)
Helper: remove all sets files from mesh instance.
void setInstance(const fileName &instance, const IOobject::writeOption wOpt=IOobject::AUTO_WRITE)
Set the instance for mesh files.
bool found(const word &optName) const
Return true if the named option is found.
Description of cuts across cells.