48 const label oldI = newToOld[i];
52 newElems[i] = elems[oldI];
63 const bitSet& isMasterElem,
70 <<
"Number of elements in list " <<
values.size()
71 <<
" does not correspond to number of elements in isMasterElem " 72 << isMasterElem.
size()
81 if (isMasterElem.
test(i))
108 const UList<T>& faceData,
109 const UList<T>& syncedFaceData
112 const label nBFaces = mesh_.nBoundaryFaces();
114 if (faceData.size() != nBFaces || syncedFaceData.size() != nBFaces)
117 <<
"Boundary faces:" << nBFaces
118 <<
" faceData:" << faceData.size()
119 <<
" syncedFaceData:" << syncedFaceData.size()
123 const polyBoundaryMesh&
patches = mesh_.boundaryMesh();
129 label bFacei =
pp.start() - mesh_.nInternalFaces();
133 const T& data = faceData[bFacei];
134 const T& syncData = syncedFaceData[bFacei];
136 if (
mag(data - syncData) > tol)
138 label facei =
pp.start()+i;
144 <<
" fc:" << mesh_.faceCentres()[facei]
145 <<
" patch:" <<
pp.name()
146 <<
" faceData:" << data
147 <<
" syncedFaceData:" << syncData
148 <<
" diff:" <<
mag(data - syncData)
191 for (
const label allPointi : visitOrder)
199 template<
class GeoField>
200 void Foam::meshRefinement::addPatchFields
203 const word& patchFieldType
206 HashTable<GeoField*> flds
208 mesh.objectRegistry::lookupClass<GeoField>()
213 GeoField&
fld = *iter();
214 auto& fldBf =
fld.boundaryFieldRef();
216 label sz = fldBf.size();
232 template<
class GeoField>
233 void Foam::meshRefinement::reorderPatchFields
239 HashTable<GeoField*> flds
241 mesh.objectRegistry::lookupClass<GeoField>()
246 iter()->boundaryFieldRef().reorder(oldToNew);
251 template<
class EnumContainer>
254 const EnumContainer& namedEnum,
260 for (
const word& w : words)
262 flags |= namedEnum[w];
273 const bitSet& isMasterEdge,
284 || edges.
size() != edgeWeights.
size()
285 || meshPoints.
size() != pointData.
size()
289 <<
"Inconsistent sizes for edge or point data:" 290 <<
" isMasterEdge:" << isMasterEdge.
size()
291 <<
" edgeWeights:" << edgeWeights.
size()
292 <<
" edges:" << edges.
size()
293 <<
" pointData:" << pointData.
size()
294 <<
" meshPoints:" << meshPoints.
size()
298 sum.setSize(meshPoints.
size());
303 if (isMasterEdge.
test(edgeI))
305 const edge&
e = edges[edgeI];
307 scalar eWeight = edgeWeights[edgeI];
312 sum[v0] += eWeight*pointData[v1];
313 sum[v1] += eWeight*pointData[v0];
350 <<
"Entry '" << keyword <<
"' not found in dictionary "
void size(const label n)
Older name for setAddressableSize.
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &f1)
"blocking" : (MPI_Bsend, MPI_Recv)
errorManipArg< error, int > exit(error &err, const int errNo=1)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
void transfer(List< T > &list)
Transfer the contents of the argument List into this list and annul the argument list.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
A list of keyword definitions, which are a keyword followed by a number of values (eg...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
labelList sortedOrder(const UList< T > &input)
Return the (stable) sort order for the list.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
constexpr char nl
The newline '\n' character (0x0a)
static Type get(const dictionary &dict, const word &keyword, const bool noExit, enum keyType::option matchOpt=keyType::REGEX, const Type &deflt=Zero)
Wrapper around dictionary::get which does not exit.
Ostream & endl(Ostream &os)
Add newline and flush stream.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tf1, const word &name, const dimensionSet &dimensions, const bool initCopy=false)
Global function forwards to reuseTmpDimensionedField::New.
static int & msgType() noexcept
Message tag of standard messages.
const fileName & name() const noexcept
The dictionary name.
#define forAll(list, i)
Loop across all elements in list.
bool readEntry(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX, IOobjectOption::readOption readOpt=IOobjectOption::MUST_READ) const
Find entry and assign to T val. FatalIOError if it is found and the number of tokens is incorrect...
List< T > values(const HashTable< T, Key, Hash > &tbl, const bool doSort=false)
List of values from HashTable, optionally sorted.
static void updateList(const labelList &newToOld, const T &nullValue, List< T > &elems)
Helper: reorder list according to map.
Calculates a unique integer (label so might not have enough room - 2G max) for processor + local inde...
const dimensionedScalar e
Elementary charge.
A class for handling words, derived from Foam::string.
Reading is optional [identical to LAZY_READ].
#define forAllIters(container, iter)
Iterate across all elements in the container object.
void testSyncBoundaryFaceList(const scalar mergeDistance, const string &, const UList< T > &, const UList< T > &) const
Compare two lists over all boundary faces.
errorManip< error > abort(error &err)
bool test(const label pos) const
Test for True value at specified position, never auto-vivify entries.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
static int readFlags(const EnumContainer &namedEnum, const wordList &words)
Helper: convert wordList into bit pattern using provided Enum.
Database for solution data, solver performance and other reduced data.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< ' ';}gmvFile<< nl;for(const word &name :lagrangianScalarNames){ IOField< scalar > fld(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
List< word > wordList
List of word.
Calculates points shared by more than two processor patches or cyclic patches.
static void collectAndPrint(const UList< point > &points, const UList< T > &data)
Print list according to (collected and) sorted coordinate.
vector point
Point is a vector.
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
const polyBoundaryMesh & patches
option
Enumeration for the data type and search/match modes (bitmask)
void reduce(const List< UPstream::commsStruct > &comms, T &value, const BinaryOp &bop, const int tag, const label comm)
Reduce inplace (cf. MPI Allreduce) using specified communication schedule.
messageStream Info
Information stream (stdout output on master, null elsewhere)
const fvBoundaryMesh & boundary() const noexcept
Return reference to boundary mesh.
Mesh consisting of general polyhedral cells.
List< label > labelList
A List of labels.
static T gAverage(const bitSet &isMasterElem, const UList< T > &values)
Helper: calculate average.
static void weightedSum(const polyMesh &mesh, const bitSet &isMasterEdge, const labelList &meshPoints, const edgeList &edges, const scalarField &edgeWeights, const Field< Type > &data, Field< Type > &sum)
Helper: weighted sum (over all subset of mesh points) by.
label size() const noexcept
Number of entries.
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())
static constexpr const zero Zero
Global zero (0)
readOption
Enumeration defining read preferences.