48 const label oldI = newToOld[i];
52 newElems[i] = elems[oldI];
63 const bitSet& isMasterElem,
67 if (values.size() != isMasterElem.
size())
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))
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()
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)
193 Info<< allPoints[allPointi] <<
" : " << allData[allPointi]
199template<
class GeoField>
200void Foam::meshRefinement::addPatchFields
203 const word& patchFieldType
208 mesh.objectRegistry::lookupClass<GeoField>()
213 GeoField&
fld = *iter();
214 auto& fldBf =
fld.boundaryFieldRef();
216 label sz = fldBf.size();
232template<
class GeoField>
233void Foam::meshRefinement::reorderPatchFields
239 HashTable<GeoField*> flds
241 mesh.objectRegistry::lookupClass<GeoField>()
246 iter()->boundaryFieldRef().reorder(oldToNew);
251template<
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];
343 <<
"Entry '" << keyword <<
"' not found in dictionary "
Info<< nl<< "Wrote faMesh in vtk format: "<< writer.output().name()<< nl;}{ vtk::lineWriter writer(aMesh.points(), aMesh.edges(), fileName(aMesh.mesh().time().globalPath()/"finiteArea-edges"));writer.writeGeometry();writer.beginCellData(4);writer.writeProcIDs();{ Field< scalar > fld(faMeshTools::flattenEdgeField(aMesh.magLe(), true))
A HashTable similar to std::unordered_map.
void transfer(List< T > &list)
unsigned int get() const
Get value as unsigned, no range-checking.
label size() const noexcept
Number of entries.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
void size(const label n)
Older name for setAddressableSize.
static int & msgType() noexcept
Message tag of standard messages.
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
bool test(const label pos) const
Test value at specified position, never auto-vivify entries.
Database for solution data, solver performance and other reduced data.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
const fileName & name() const noexcept
The dictionary name.
bool readEntry(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX, bool mandatory=true) const
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
Mesh data needed to do the Finite Volume discretisation.
const fvBoundaryMesh & boundary() const
Return reference to boundary mesh.
Calculates a unique integer (label so might not have enough room - 2G max) for processor + local inde...
Calculates points shared by more than two processor patches or cyclic patches.
option
Enumeration for the data type and search/match modes (bitmask)
static T gAverage(const bitSet &isMasterElem, const UList< T > &values)
Helper: calculate average.
static void collectAndPrint(const UList< point > &points, const UList< T > &data)
Print list according to (collected and) sorted coordinate.
static int readFlags(const EnumContainer &namedEnum, const wordList &words)
Helper: convert wordList into bit pattern using provided Enum.
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.
void testSyncBoundaryFaceList(const scalar mergeDistance, const string &, const UList< T > &, const UList< T > &) const
Compare two lists over all boundary faces.
static void updateList(const labelList &newToOld, const T &nullValue, List< T > &elems)
Helper: reorder list according to map.
A traits class, which is primarily used for primitives.
const word & name() const noexcept
The patch name.
A polyBoundaryMesh is a polyPatch list with additional search methods and registered IO.
Mesh consisting of general polyhedral cells.
A patch is a list of labels that address the faces in the global face list.
label start() const
Return start label of this patch in the polyMesh face list.
A class for handling words, derived from Foam::string.
const polyBoundaryMesh & patches
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
List< label > labelList
A List of labels.
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &df)
messageStream Info
Information stream (stdout output on master, null elsewhere)
vector point
Point is a vector.
Ostream & endl(Ostream &os)
Add newline and flush stream.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
void reduce(const List< UPstream::commsStruct > &comms, T &value, const BinaryOp &bop, const int tag, const label comm)
labelList sortedOrder(const UList< T > &input)
Return the (stable) sort order for the list.
errorManip< error > abort(error &err)
static constexpr const zero Zero
Global zero (0)
errorManipArg< error, int > exit(error &err, const int errNo=1)
constexpr char nl
The newline '\n' character (0x0a)
#define forAll(list, i)
Loop across all elements in list.
#define forAllIters(container, iter)
Iterate across all elements in the container object.