diff --git a/src/OSspecific/POSIX/signals/sigFpe.C b/src/OSspecific/POSIX/signals/sigFpe.C index 6b48544ec..d849cb74c 100644 --- a/src/OSspecific/POSIX/signals/sigFpe.C +++ b/src/OSspecific/POSIX/signals/sigFpe.C @@ -326,7 +326,7 @@ void Foam::sigFpe::set(const bool verbose) { vm_protect( mach_task_self(), - (uintptr_t)zone, + reinterpret_cast(zone), sizeof(malloc_zone_t), 0, VM_PROT_READ | VM_PROT_WRITE @@ -338,7 +338,7 @@ void Foam::sigFpe::set(const bool verbose) { vm_protect( mach_task_self(), - (uintptr_t)zone, + reinterpret_cast(zone), sizeof(malloc_zone_t), 0, VM_PROT_READ diff --git a/src/coupledMatrix/coupledFvMatrices/coupledFvMatrix/coupledFvMatrix.C b/src/coupledMatrix/coupledFvMatrices/coupledFvMatrix/coupledFvMatrix.C index 6dade9e19..b982884a3 100644 --- a/src/coupledMatrix/coupledFvMatrices/coupledFvMatrix/coupledFvMatrix.C +++ b/src/coupledMatrix/coupledFvMatrices/coupledFvMatrix/coupledFvMatrix.C @@ -100,12 +100,14 @@ Foam::coupledFvMatrix::solve(const dictionary& solverControls) fvMatrix& curMatrix = static_cast& >(matrices[rowI]); + // HR 12.03.19: Complete assembly before making copies. + curMatrix.completeAssembly(); + saveDiag.set(rowI, new scalarField(curMatrix.diag())); psiCmpt.set(rowI, new scalarField(curMatrix.psi().size())); source.set(rowI, new Field(curMatrix.source())); sourceCmpt.set(rowI, new scalarField(curMatrix.psi().size())); - curMatrix.completeAssembly(); curMatrix.addBoundarySource(source[rowI]); interfaces[rowI] = curMatrix.psi().boundaryField().interfaces(); diff --git a/src/foam/containers/NamedEnum/NamedEnum.C b/src/foam/containers/NamedEnum/NamedEnum.C index d5421cea2..776162ef9 100644 --- a/src/foam/containers/NamedEnum/NamedEnum.C +++ b/src/foam/containers/NamedEnum/NamedEnum.C @@ -23,9 +23,15 @@ License \*---------------------------------------------------------------------------*/ -#include "NamedEnum.H" #include "stringList.H" +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + + +template +const char* Foam::NamedEnum::names[nEnum]; + + // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // template diff --git a/src/thermophysicalModels/radiation/radiationModel/viewFactor/viewFactor.C b/src/thermophysicalModels/radiation/radiationModel/viewFactor/viewFactor.C index 60a8ba652..3c81fc7c1 100644 --- a/src/thermophysicalModels/radiation/radiationModel/viewFactor/viewFactor.C +++ b/src/thermophysicalModels/radiation/radiationModel/viewFactor/viewFactor.C @@ -64,7 +64,7 @@ void Foam::radiation::viewFactor::initialise() } } - selectedPatches_.resize(count--); + selectedPatches_.resize(count); if (debug) { @@ -173,6 +173,82 @@ void Foam::radiation::viewFactor::initialise() globalIndex globalNumbering(nLocalCoarseFaces_); + // Calculate global face areas + scalarField compactCoarseMagSf(map_->constructSize(), 0.0); + DynamicList localCoarseMagSf(nLocalCoarseFaces_); + + forAll (selectedPatches_, i) + { + label patchID = selectedPatches_[i]; + + const scalarField& sf = mesh_.magSf().boundaryField()[patchID]; + + const polyPatch& pp = coarseMesh_.boundaryMesh()[patchID]; + const labelList& coarsePatchFace = coarseMesh_.patchFaceMap()[patchID]; + + scalarList magSf(pp.size(), 0.0); + + if (pp.size() > 0) + { + const labelList& agglom = finalAgglom_[patchID]; + label nAgglom = max(agglom) + 1; + + labelListList coarseToFine(invertOneToMany(nAgglom, agglom)); + + forAll (coarseToFine, coarseI) + { + const label coarseFaceID = coarsePatchFace[coarseI]; + const labelList& fineFaces = coarseToFine[coarseFaceID]; + UIndirectList fineSf + ( + sf, + fineFaces + ); + magSf[coarseI] = sum(fineSf()); + } + } + + localCoarseMagSf.append(magSf); + } + + // Fill the local values to distribute + SubList(compactCoarseMagSf, nLocalCoarseFaces_).assign(localCoarseMagSf); + + // Distribute data + map_->distribute(compactCoarseMagSf); + + // Distribute local global ID + labelList compactGlobalIds(map_->constructSize(), 0.0); + + labelList localGlobalIds(nLocalCoarseFaces_); + + for(label k = 0; k < nLocalCoarseFaces_; k++) + { + localGlobalIds[k] = globalNumbering.toGlobal(Pstream::myProcNo(), k); + } + + SubList