40 namespace decompositionConstraints
62 selection_(coeffDict_.subDict(
"selection")),
63 grow_(
dict.getOrDefault(
"grow", false))
70 <<
" : adding " << selection_.size()
71 <<
" geometric constraints for faces" <<
endl;
82 sources_(
std::move(selections)),
89 <<
" : adding " << sources_.size()
90 <<
" geometric constraints for faces" <<
endl;
106 const label nFaces =
mesh.nFaces();
108 blockedFace.
resize(nFaces,
true);
117 faceBoolSet facesToBlock(
mesh, std::move(blockedFace));
119 for (
const topoSetFaceSource& source : sources_)
125 for (
const entry& dEntry : selection_)
127 if (!dEntry.isDict())
130 <<
"Ignoring non-dictionary entry " 135 const dictionary& spec = dEntry.dict();
139 spec.get<word>(
"source"),
141 spec.optionalSubDict(
"sourceInfo")
150 blockedFace.
transfer(facesToBlock.addressing());
166 bitSet moreUnblocking(nFaces,
false);
168 label nUnblocked = 0;
170 for (label celli=0; celli <
mesh.nCells(); ++celli)
172 const cell& cFaces =
mesh.cells()[celli];
175 for (
const label facei : cFaces)
177 if (!blockedFace[facei])
189 moreUnblocking.set(cFaces);
195 for (label facei : moreUnblocking)
197 if (blockedFace[facei])
199 blockedFace[facei] =
false;
207 <<
" : geometric constraint grow added " 213 nchanged += nUnblocked;
219 <<
" : geometric constraint added for " Abstract class for handling decomposition constraints.
void resize(const label len)
Adjust allocated size of list.
void transfer(List< T > &list)
Transfer the contents of the argument List into this list and annul the argument list.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Keep faces together based on geometric considerations from a list of topoSetFaceSource. The faces selected (inside) of each source are to be kept together during the decomposition.
geometric(const dictionary &dict)
Construct with constraint dictionary.
Ostream & endl(Ostream &os)
Add newline and flush stream.
T returnReduce(const T &value, const BinaryOp &bop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Perform reduction on a copy, using specified binary operation.
static autoPtr< topoSetFaceSource > New(const word &sourceType, const polyMesh &mesh, const dictionary &dict)
Return a reference to the selected source type.
Macros for easy insertion into run-time selection tables.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
unsigned int count(const UList< bool > &bools, const bool val=true)
Count number of 'true' entries.
int debug
Static debugging option.
Subtract elements from current set.
#define WarningInFunction
Report a warning using Foam::Warning.
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers...
addToRunTimeSelectionTable(decompositionConstraint, geometric, dictionary)
messageStream Info
Information stream (stdout output on master, null elsewhere)
Mesh consisting of general polyhedral cells.
virtual void add(const polyMesh &mesh, boolList &blockedFace, PtrList< labelList > &specifiedProcessorFaces, labelList &specifiedProcessor, List< labelPair > &explicitConnections) const
Add this constraint to list of constraints.
defineTypeName(geometric)