diff --git a/applications/utilities/postProcessing/miscellaneous/writeCellCentres/writeCellCentres.C b/applications/utilities/postProcessing/miscellaneous/writeCellCentres/writeCellCentres.C index 6e4f009be2..ef8fe01b83 100644 --- a/applications/utilities/postProcessing/miscellaneous/writeCellCentres/writeCellCentres.C +++ b/applications/utilities/postProcessing/miscellaneous/writeCellCentres/writeCellCentres.C @@ -98,6 +98,7 @@ int main(int argc, char *argv[]) cci.write(); } + volScalarField V ( IOobject @@ -110,10 +111,19 @@ int main(int argc, char *argv[]) false ), mesh, - + dimensionedScalar("V", mesh.V().dimensions(), 0.0), + calculatedFvPatchField::typeName ); - mesh.V().setInstance(runTime.timeName()); - mesh.V().write(); + V.dimensionedInternalField() = mesh.V(); + forAll(V.boundaryField(), patchI) + { + V.boundaryField()[patchI] = + V.boundaryField()[patchI].patch().magSf(); + } + Info<< "Writing cellVolumes and patch faceAreas to " << V.name() + << " in " << runTime.timeName() << endl; + V.write(); + } Info<< "\nEnd\n" << endl; diff --git a/src/OpenFOAM/meshes/lduMesh/lduMesh.C b/src/OpenFOAM/meshes/lduMesh/lduMesh.C index 2ab4cfe046..bd7c6aacd5 100644 --- a/src/OpenFOAM/meshes/lduMesh/lduMesh.C +++ b/src/OpenFOAM/meshes/lduMesh/lduMesh.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -44,4 +44,104 @@ const Foam::objectRegistry& Foam::lduMesh::thisDb() const } +// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * // + +Foam::Ostream& Foam::operator<<(Ostream& os, const InfoProxy& ip) +{ + const lduMesh& ldum = ip.t_; + const lduAddressing& addr = ldum.lduAddr(); + const lduInterfacePtrsList interfaces = ldum.interfaces(); + + os << "lduMesh :" + << " size:" << addr.size() + << " l:" << addr.lowerAddr().size() + << " u:" << addr.upperAddr().size() + << " interfaces:" << interfaces.size() + << " comm:" << ldum.comm() + << endl; + label nCouples = 0; + forAll(interfaces, i) + { + if (interfaces.set(i)) + { + const labelUList& faceCells = addr.patchAddr(i); + nCouples += faceCells.size(); + + if (isA(interfaces[i])) + { + const processorLduInterface& pi = refCast + < + const processorLduInterface + >(interfaces[i]); + + os << " patch:" << i + << " type:" << interfaces[i].type() + << " size:" << faceCells.size() + << " myProcNo:" << pi.myProcNo() + << " neighbProcNo:" << pi.neighbProcNo() + << " comm:" << pi.comm() + << endl; + } + else + { + os << " patch:" << i + << " type:" << interfaces[i].type() + << " size:" << faceCells.size() + << endl; + } + } + } + os << " Interface faces/cells:" << scalar(nCouples)/addr.size() + << endl; + + + // Print actual contents + if (lduMesh::debug) + { + const labelList& l = addr.lowerAddr(); + const labelList& u = addr.upperAddr(); + forAll(l, faceI) + { + os << " face:" << faceI << " l:" << l[faceI] + << " u:" << u[faceI] << endl; + } + forAll(interfaces, i) + { + if (interfaces.set(i)) + { + const labelUList& faceCells = addr.patchAddr(i); + if (faceCells.size()) + { + os << " patch:" << i + << " type:" << interfaces[i].type() << endl; + + if (isA(interfaces[i])) + { + const processorLduInterface& pi = refCast + < + const processorLduInterface + >(interfaces[i]); + + os << " myProcNo:" << pi.myProcNo() + << " neighbProcNo:" << pi.neighbProcNo() + << " comm:" << pi.comm() + << endl; + } + + forAll(faceCells, i) + { + os << " " << i << " own:" << faceCells[i] + << endl; + } + } + } + } + } + + os.check("Ostream& operator<<(Ostream&, const lduMesh&"); + + return os; +} + + // ************************************************************************* // diff --git a/src/OpenFOAM/meshes/lduMesh/lduMesh.H b/src/OpenFOAM/meshes/lduMesh/lduMesh.H index 0c3314452a..aa96663e49 100644 --- a/src/OpenFOAM/meshes/lduMesh/lduMesh.H +++ b/src/OpenFOAM/meshes/lduMesh/lduMesh.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -36,6 +36,7 @@ Description #include "lduAddressing.H" #include "lduInterfacePtrsList.H" #include "typeInfo.H" +#include "InfoProxy.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -77,6 +78,19 @@ public: //- Return a list of pointers for each patch // with only those pointing to interfaces being set virtual lduInterfacePtrsList interfaces() const = 0; + + // Info + + //- Return info proxy. + // Used to print mesh information to a stream + InfoProxy info() const + { + return *this; + } + + // Ostream operator + + friend Ostream& operator<<(Ostream&, const InfoProxy&); }; diff --git a/src/OpenFOAM/meshes/polyMesh/polyMeshCheck/polyMeshTools.C b/src/OpenFOAM/meshes/polyMesh/polyMeshCheck/polyMeshTools.C index 59947b0fbe..3af85508be 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyMeshCheck/polyMeshTools.C +++ b/src/OpenFOAM/meshes/polyMesh/polyMeshCheck/polyMeshTools.C @@ -178,7 +178,7 @@ Foam::tmp Foam::polyMeshTools::faceSkewness } // Normalised skewness - skew[faceI] = mag(sv)/fd; + skew[faceI] = mag(sv)/fd; } } } diff --git a/src/finiteVolume/fvMesh/fvMesh.C b/src/finiteVolume/fvMesh/fvMesh.C index 8185c2a084..f42499c3f4 100644 --- a/src/finiteVolume/fvMesh/fvMesh.C +++ b/src/finiteVolume/fvMesh/fvMesh.C @@ -192,7 +192,7 @@ Foam::fvMesh::fvMesh(const IOobject& io) time().timeName(), *this, IOobject::MUST_READ, - IOobject::AUTO_WRITE, + IOobject::NO_WRITE, false ), *this @@ -588,7 +588,7 @@ Foam::tmp Foam::fvMesh::movePoints(const pointField& p) this->time().timeName(), *this, IOobject::NO_READ, - IOobject::AUTO_WRITE, + IOobject::NO_WRITE, false ), *this,