45 label oldI = newToOld[i];
49 newElems[i] = elems[oldI];
64 if (values.
size() != isMasterElem.
size())
67 <<
"Number of elements in list " << values.
size()
68 <<
" does not correspond to number of elements in isMasterElem " 69 << isMasterElem.
size()
109 label nBFaces = mesh_.nFaces() - mesh_.nInternalFaces();
111 if (faceData.
size() != nBFaces || syncedFaceData.
size() != nBFaces)
114 <<
"Boundary faces:" << nBFaces
115 <<
" faceData:" << faceData.
size()
116 <<
" syncedFaceData:" << syncedFaceData.
size()
126 label bFacei = pp.
start() - mesh_.nInternalFaces();
130 const T& data = faceData[bFacei];
131 const T& syncData = syncedFaceData[bFacei];
133 if (
mag(data - syncData) > tol)
141 <<
" fc:" << mesh_.faceCentres()[facei]
142 <<
" patch:" << pp.
name()
143 <<
" faceData:" << data
144 <<
" syncedFaceData:" << syncData
145 <<
" diff:" <<
mag(data - syncData)
195 label allPointi = visitOrder[i];
196 Info<< allPoints[allPointi] <<
" : " << allData[allPointi]
202 template<
class GeoField>
203 void Foam::meshRefinement::addPatchFields
206 const word& patchFieldType
211 mesh.objectRegistry::lookupClass<GeoField>()
216 GeoField&
fld = *iter();
217 typename GeoField::Boundary& fldBf =
218 fld.boundaryFieldRef();
220 label sz = fldBf.size();
236 template<
class GeoField>
237 void Foam::meshRefinement::reorderPatchFields
245 mesh.objectRegistry::lookupClass<GeoField>()
250 iter()->boundaryFieldRef().reorder(oldToNew);
258 const Enum& namedEnum,
266 int index = namedEnum[words[i]];
289 || edges.
size() != edgeWeights.
size()
290 || meshPoints.
size() != pointData.
size()
294 <<
"Inconsistent sizes for edge or point data:" 295 <<
" isMasterEdge:" << isMasterEdge.
size()
296 <<
" edgeWeights:" << edgeWeights.
size()
297 <<
" edges:" << edges.
size()
298 <<
" pointData:" << pointData.
size()
299 <<
" meshPoints:" << meshPoints.
size()
308 if (isMasterEdge[edgeI])
310 const edge&
e = edges[edgeI];
312 scalar eWeight = edgeWeights[edgeI];
317 sum[v0] += eWeight*pointData[v1];
318 sum[v1] += eWeight*pointData[v0];
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
void sortedOrder(const UList< T > &, labelList &order)
Generate the (stable) sort order for the list.
errorManipArg< error, int > exit(error &err, const int errNo=1)
const double e
Elementary charge.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
#define forAllIter(Container, container, iter)
Iterate across all elements in the container object of type.
void size(const label)
Override size to be inconsistent with allocated storage.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Traits class for primitives.
labelList identity(const label len)
Create identity map (map[i] == i) of given length.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
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...
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){gmvFile<< iter().position().x()<< ' ';}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){gmvFile<< iter().position().y()<< ' ';}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){gmvFile<< iter().position().z()<< ' ';}gmvFile<< nl;forAll(lagrangianScalarNames, i){const word &name=lagrangianScalarNames[i];IOField< scalar > fld(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
label start() const
Return start label of this patch in the polyMesh face list.
static void weightedSum(const polyMesh &mesh, const PackedBoolList &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.
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
A class for handling words, derived from string.
void testSyncBoundaryFaceList(const scalar mergeDistance, const string &, const UList< T > &, const UList< T > &) const
Compare two lists over all boundary faces.
const word & name() const
Return name.
An STL-conforming hash table.
errorManip< error > abort(error &err)
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 Enum &namedEnum, const wordList &)
Helper: convert wordList into bit pattern using provided.
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
label size() const
Return the number of elements in the UList.
Calculates points shared by more than two processor patches or cyclic patches.
void setSize(const label)
Reset size of List.
static void collectAndPrint(const UList< point > &points, const UList< T > &data)
Print list according to (collected and) sorted coordinate.
static T gAverage(const PackedBoolList &isMasterElem, const UList< T > &values)
Helper: calculate average.
vector point
Point is a vector.
Mesh data needed to do the Finite Volume discretisation.
dimensioned< scalar > mag(const dimensioned< Type > &)
Mesh consisting of general polyhedral cells.
A patch is a list of labels that address the faces in the global face list.
label size() const
Number of entries.
const fvBoundaryMesh & boundary() const
Return reference to boundary mesh.
void transfer(List< T > &)
Transfer the contents of the argument List into this list.