62 selection_(coeffDict_.subDict(
"selection")),
63 grow_(
dict.getOrDefault(
"grow", false))
67 if (decompositionConstraint::debug)
70 <<
" : adding " << selection_.size()
71 <<
" geometric constraints for faces" <<
endl;
82 sources_(std::move(selections)),
86 if (decompositionConstraint::debug)
89 <<
" : adding " << sources_.size()
90 <<
" geometric constraints for faces" <<
endl;
106 const label nFaces =
mesh.nFaces();
108 blockedFace.
resize(nFaces,
true);
111 if (decompositionConstraint::debug)
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 "
139 spec.get<word>(
"source"),
141 spec.optionalSubDict(
"sourceInfo")
150 blockedFace.
transfer(facesToBlock.addressing());
152 if (decompositionConstraint::debug)
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;
204 if (decompositionConstraint::debug)
207 <<
" : geometric constraint grow added "
213 nchanged += nUnblocked;
216 if (decompositionConstraint::debug)
219 <<
" : geometric constraint added for "
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
void transfer(List< T > &list)
Transfer the contents of the argument List into this list and annul the argument list.
void resize(const label len)
Adjust allocated size of list.
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
void set(const bitSet &bitset)
Set specified bits from another bitset.
A cell is defined as a list of faces with extra functionality.
Abstract class for handling decomposition constraints.
dictionary coeffDict_
Constraint coefficients dictionary.
decompositionConstraint(const decompositionConstraint &)=delete
No copy construct.
Keep faces together based on geometric considerations from a list of topoSetFaceSource....
geometric(const dictionary &dict)
Construct with constraint dictionary.
virtual void add(const polyMesh &mesh, boolList &blockedFace, PtrList< labelList > &specifiedProcessorFaces, labelList &specifiedProcessor, List< labelPair > &explicitConnections) const
Add this constraint to list of constraints.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a T. FatalIOError if not found, or if the number of tokens is incorrect.
const dictionary & optionalSubDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a sub-dictionary, otherwise return this dictionary.
A keyword and a list of tokens is an 'entry'.
A special purpose topoSet with the face labels stored as a boolList. It does not correspond to a face...
Mesh consisting of general polyhedral cells.
const boolList & addressing() const noexcept
Return the boolList.
The topoSetFaceSource is a intermediate class for handling topoSet sources for selecting faces.
static autoPtr< topoSetFaceSource > New(const word &sourceType, const polyMesh &mesh, const dictionary &dict)
Return a reference to the selected source type.
@ SUBTRACT
Subtract elements from current set.
A class for handling words, derived from Foam::string.
#define defineTypeName(Type)
Define the typeName.
#define WarningInFunction
Report a warning using Foam::Warning.
unsigned int count(const UList< bool > &bools, const bool val=true)
Count number of 'true' entries.
List< label > labelList
A List of labels.
messageStream Info
Information stream (stdout output on master, null elsewhere).
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
T returnReduce(const T &value, BinaryOp bop, const int tag=UPstream::msgType(), const int communicator=UPstream::worldComm)
Perform reduction on a copy, using specified binary operation.
const word GlobalIOList< Tuple2< scalar, vector > >::typeName("scalarVectorTable")
Ostream & endl(Ostream &os)
Add newline and flush stream.
List< bool > boolList
A List of bools.