62 int main(
int argc,
char *argv[])
74 "Restrict cells to refine to those in specified cellSet"
84 const word oldInstance = mesh.pointsInstance();
96 <<
"Cannot find any patches in set " <<
patches <<
endl
97 <<
"Valid patches are " << mesh.boundaryMesh().names()
101 label nPatchFaces = 0;
102 label nPatchEdges = 0;
106 nPatchFaces += mesh.boundaryMesh()[iter.key()].size();
107 nPatchEdges += mesh.boundaryMesh()[iter.key()].nEdges();
123 forAll(meshPoints, pointi)
125 const label meshPointi = meshPoints[pointi];
127 const labelList& pCells = mesh.pointCells()[meshPointi];
131 cutCells.insert(pCells[pCelli]);
139 Info<<
"Restrict cells to refine to those in cellSet "
142 const cellSet cellsToRefine(mesh, setName);
144 Info<<
" Read " << cellsToRefine.size()
145 <<
" cells from cellSet " << cellsToRefine.relativeObjectPath()
150 if (!cellsToRefine.found(iter.key()))
152 cutCells.erase(iter);
158 boolList vertOnPatch(mesh.nPoints(),
false);
165 forAll(meshPoints, pointi)
167 vertOnPatch[meshPoints[pointi]] =
true;
176 forAll(meshPoints, pointi)
178 const label meshPointi = meshPoints[pointi];
180 const labelList& pEdges = mesh.pointEdges()[meshPointi];
184 const label edgeI = pEdges[pEdgeI];
185 const edge&
e = mesh.edges()[edgeI];
187 label otherPointi =
e.otherVertex(meshPointi);
189 if (!vertOnPatch[otherPointi])
191 allCutEdges.append(edgeI);
193 if (
e.start() == meshPointi)
195 allCutEdgeWeights.append(weight);
199 allCutEdgeWeights.append(1 - weight);
206 allCutEdges.shrink();
207 allCutEdgeWeights.shrink();
210 <<
" cells:" << cutCells.size() <<
nl
211 <<
" edges:" << allCutEdges.size() <<
endl;
215 cutEdgeWeights.
transfer(allCutEdgeWeights);
216 allCutEdgeWeights.clear();
235 cutter.setRefinement(cuts, meshMod);
245 cutter.topoChange(map());
251 mesh.setInstance(oldInstance);
255 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.
virtual Ostream & write(const char)=0
Write character.
const labelList & meshPoints() const
Return labelList of mesh points in patch. They are constructed.
static void addOption(const word &opt, const string ¶m="", const string &usage="")
Add to an option to validOptions with usage information.
bool optionFound(const word &opt) const
Return true if the named option is found.
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...
static word defaultRegion
Return the default region name.
A patch is a list of labels that address the faces in the global face list.
const polyBoundaryMesh & boundaryMesh() const
Return boundaryMesh reference.
Direct mesh changes based on v1.3 polyTopoChange syntax.
A class for handling words, derived from string.
#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)