diff --git a/applications/solvers/multiphase/interFoam/alphaEqn.H b/applications/solvers/multiphase/interFoam/alphaEqn.H index dc1146944e..b96dcf898d 100644 --- a/applications/solvers/multiphase/interFoam/alphaEqn.H +++ b/applications/solvers/multiphase/interFoam/alphaEqn.H @@ -29,7 +29,7 @@ rhoPhi = phiAlpha*(rho1 - rho2) + phi*rho2; } - Info<< "Liquid phase volume fraction = " + Info<< "Phase-1 volume fraction = " << alpha1.weightedAverage(mesh.Vsc()).value() << " Min(alpha1) = " << min(alpha1).value() << " Max(alpha1) = " << max(alpha1).value() diff --git a/applications/test/tensor2D/Make/files b/applications/test/tensor2D/Make/files new file mode 100644 index 0000000000..29b058c0ff --- /dev/null +++ b/applications/test/tensor2D/Make/files @@ -0,0 +1,3 @@ +Test-tensor2D.C + +EXE = $(FOAM_USER_APPBIN)/Test-tensor2D diff --git a/applications/test/tensor2D/Make/options b/applications/test/tensor2D/Make/options new file mode 100644 index 0000000000..e69de29bb2 diff --git a/applications/test/tensor2D/Test-tensor2D.C b/applications/test/tensor2D/Test-tensor2D.C new file mode 100644 index 0000000000..367c924470 --- /dev/null +++ b/applications/test/tensor2D/Test-tensor2D.C @@ -0,0 +1,14 @@ +#include "tensor2D.H" +#include "IOstreams.H" + +using namespace Foam; + +int main() +{ + vector2D v1(1, 2), v2(3, 4); + tensor2D t = v1*v2; + + Info<< "v1(1, 2)*v2(3, 4) = " << t << endl; + + return 0; +} diff --git a/src/OpenFOAM/matrices/lduMatrix/lduAddressing/lduInterface/processorLduInterfaceTemplates.C b/src/OpenFOAM/matrices/lduMatrix/lduAddressing/lduInterface/processorLduInterfaceTemplates.C index e7d84ce484..396845ffe8 100644 --- a/src/OpenFOAM/matrices/lduMatrix/lduAddressing/lduInterface/processorLduInterfaceTemplates.C +++ b/src/OpenFOAM/matrices/lduMatrix/lduAddressing/lduInterface/processorLduInterfaceTemplates.C @@ -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) 2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -36,6 +36,8 @@ void Foam::processorLduInterface::send const UList& f ) const { + label nBytes = f.byteSize(); + if (commsType == Pstream::blocking || commsType == Pstream::scheduled) { OPstream::write @@ -43,32 +45,32 @@ void Foam::processorLduInterface::send commsType, neighbProcNo(), reinterpret_cast(f.begin()), - f.byteSize(), + nBytes, tag() ); } else if (commsType == Pstream::nonBlocking) { - resizeBuf(receiveBuf_, f.size()*sizeof(Type)); + resizeBuf(receiveBuf_, nBytes); IPstream::read ( commsType, neighbProcNo(), receiveBuf_.begin(), - receiveBuf_.size(), + nBytes, tag() ); - resizeBuf(sendBuf_, f.byteSize()); - memcpy(sendBuf_.begin(), f.begin(), f.byteSize()); + resizeBuf(sendBuf_, nBytes); + memcpy(sendBuf_.begin(), f.begin(), nBytes); OPstream::write ( commsType, neighbProcNo(), sendBuf_.begin(), - f.byteSize(), + nBytes, tag() ); } @@ -172,7 +174,7 @@ void Foam::processorLduInterface::compressedSend commsType, neighbProcNo(), receiveBuf_.begin(), - receiveBuf_.size(), + nBytes, tag() ); diff --git a/src/OpenFOAM/meshes/polyMesh/polyMeshTetDecomposition/tetIndices.H b/src/OpenFOAM/meshes/polyMesh/polyMeshTetDecomposition/tetIndices.H index f0dea9aad8..4eb21b6ac9 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyMeshTetDecomposition/tetIndices.H +++ b/src/OpenFOAM/meshes/polyMesh/polyMeshTetDecomposition/tetIndices.H @@ -28,6 +28,24 @@ Description Storage and named access for the indices of a tet which is part of the decomposition of a cell. + Tets are designated by + - cell (of course) + - face on cell + - three points on face (faceBasePt, facePtA, facePtB) + When constructing from a mesh and index in the face (tetPtI): + - faceBasePt is the mesh.tetBasePtIs() base point + - facePtA is tetPtI away from faceBasePt + - facePtB is next one after/before facePtA + e.g.: + + +---+ + |2 /| + | / | + |/ 1| <- tetPt (so 1 for first triangle, 2 for second) + +---+ + ^ + faceBasePt + SourceFiles tetIndicesI.H tetIndices.C diff --git a/src/OpenFOAM/primitives/Tensor2D/Tensor2DI.H b/src/OpenFOAM/primitives/Tensor2D/Tensor2DI.H index 1760cc1f5f..7fe348c9d3 100644 --- a/src/OpenFOAM/primitives/Tensor2D/Tensor2DI.H +++ b/src/OpenFOAM/primitives/Tensor2D/Tensor2DI.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-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -513,6 +513,14 @@ public: }; +template +class outerProduct, Vector2D > +{ +public: + + typedef Tensor2D type; +}; + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/processor/processorFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/constraint/processor/processorFvPatchScalarField.C index c15b1c1be7..6fbb215002 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/processor/processorFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/constraint/processor/processorFvPatchScalarField.C @@ -45,11 +45,7 @@ void processorFvPatchField::initInterfaceMatrixUpdate { this->patch().patchInternalField(psiInternal, scalarSendBuf_); - if - ( - Pstream::defaultCommsType == Pstream::nonBlocking - && !Pstream::floatTransfer - ) + if (commsType == Pstream::nonBlocking && !Pstream::floatTransfer) { // Fast path. if (debug && !this->ready()) @@ -122,6 +118,7 @@ void processorFvPatchField::updateInterfaceMatrix { UPstream::waitRequest(outstandingRecvRequest_); } + // Recv finished so assume sending finished as well. outstandingSendRequest_ = -1; outstandingRecvRequest_ = -1; diff --git a/src/regionModels/thermoBaffleModels/derivedFvPatchFields/temperatureThermoBaffle/temperatureThermoBaffleFvPatchScalarField.C b/src/regionModels/thermoBaffleModels/derivedFvPatchFields/temperatureThermoBaffle/temperatureThermoBaffleFvPatchScalarField.C index ae7552ae15..cf339acd54 100644 --- a/src/regionModels/thermoBaffleModels/derivedFvPatchFields/temperatureThermoBaffle/temperatureThermoBaffleFvPatchScalarField.C +++ b/src/regionModels/thermoBaffleModels/derivedFvPatchFields/temperatureThermoBaffle/temperatureThermoBaffleFvPatchScalarField.C @@ -46,7 +46,8 @@ temperatureThermoBaffleFvPatchScalarField turbulentTemperatureCoupledBaffleMixedFvPatchScalarField(p, iF), owner_(false), baffle_(), - solidThermoType_("undefined") + solidThermoType_("undefined"), + dict_(dictionary::null) {} @@ -68,7 +69,8 @@ temperatureThermoBaffleFvPatchScalarField ), owner_(ptf.owner_), baffle_(ptf.baffle_), - solidThermoType_(ptf.solidThermoType_) + solidThermoType_(ptf.solidThermoType_), + dict_(ptf.dict_) {} @@ -83,7 +85,8 @@ temperatureThermoBaffleFvPatchScalarField turbulentTemperatureCoupledBaffleMixedFvPatchScalarField(p, iF, dict), owner_(false), baffle_(), - solidThermoType_() + solidThermoType_(), + dict_(dict) { if (!isA(patch().patch())) { @@ -133,7 +136,8 @@ temperatureThermoBaffleFvPatchScalarField turbulentTemperatureCoupledBaffleMixedFvPatchScalarField(ptf, iF), owner_(ptf.owner_), baffle_(ptf.baffle_), - solidThermoType_(ptf.solidThermoType_) + solidThermoType_(ptf.solidThermoType_), + dict_(ptf.dict_) {} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // @@ -188,30 +192,33 @@ void temperatureThermoBaffleFvPatchScalarField::write(Ostream& os) const if (thisMesh.name() == polyMesh::defaultRegion && owner_) { - os.writeKeyword("thermoBaffleModel") << baffle_->modelName() + word thermoModel = dict_.lookup("thermoBaffleModel"); + + os.writeKeyword("thermoBaffleModel") + << thermoModel << token::END_STATEMENT << nl; - os.writeKeyword("regionName") << baffle_->regionMesh().name() + word regionName = dict_.lookup("regionName"); + os.writeKeyword("regionName") << regionName << token::END_STATEMENT << nl; - os.writeKeyword("infoOutput") << baffle_->infoOutput() + bool infoOutput = readBool(dict_.lookup("infoOutput")); + os.writeKeyword("infoOutput") << infoOutput << token::END_STATEMENT << nl; - os.writeKeyword("active") << baffle_->active() + bool active = readBool(dict_.lookup("active")); + os.writeKeyword("active") << active << token::END_STATEMENT << nl; - os.writeKeyword(word(baffle_->modelName() + "coeffs")); - - os << baffle_->coeffs() << nl; + os.writeKeyword(word(thermoModel + "Coeffs")); + os << dict_.subDict(thermoModel + "Coeffs") << nl; os.writeKeyword("thermoType") << solidThermoType_ << token::END_STATEMENT << nl; - os.writeKeyword(word(solidThermoType_ + "Coeffs")) << nl; + os.writeKeyword(word(solidThermoType_ + "Coeffs")); - os << indent << '{' << nl - << indent << baffle_->thermo() << nl - << indent << '}' << nl; + os << dict_.subDict(solidThermoType_ + "Coeffs") << nl; } } diff --git a/src/regionModels/thermoBaffleModels/derivedFvPatchFields/temperatureThermoBaffle/temperatureThermoBaffleFvPatchScalarField.H b/src/regionModels/thermoBaffleModels/derivedFvPatchFields/temperatureThermoBaffle/temperatureThermoBaffleFvPatchScalarField.H index 0b979f810d..83e3162c57 100644 --- a/src/regionModels/thermoBaffleModels/derivedFvPatchFields/temperatureThermoBaffle/temperatureThermoBaffleFvPatchScalarField.H +++ b/src/regionModels/thermoBaffleModels/derivedFvPatchFields/temperatureThermoBaffle/temperatureThermoBaffleFvPatchScalarField.H @@ -112,6 +112,9 @@ class temperatureThermoBaffleFvPatchScalarField //- Solid thermo type word solidThermoType_; + //- Dictionary + dictionary dict_; + public: diff --git a/src/sampling/Make/files b/src/sampling/Make/files index 17099071a5..649f05523d 100644 --- a/src/sampling/Make/files +++ b/src/sampling/Make/files @@ -11,7 +11,7 @@ sampledSet/polyLine/polyLineSet.C sampledSet/face/faceOnlySet.C sampledSet/midPoint/midPointSet.C sampledSet/midPointAndFace/midPointAndFaceSet.C -/* sampledSet/patchSeed/patchSeedSet.C */ +sampledSet/patchSeed/patchSeedSet.C sampledSet/sampledSet/sampledSet.C sampledSet/sampledSets/sampledSets.C sampledSet/sampledSets/sampledSetsGrouping.C diff --git a/src/sampling/sampledSet/patchSeed/patchSeedSet.C b/src/sampling/sampledSet/patchSeed/patchSeedSet.C new file mode 100644 index 0000000000..09da94f70e --- /dev/null +++ b/src/sampling/sampledSet/patchSeed/patchSeedSet.C @@ -0,0 +1,239 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "patchSeedSet.H" +#include "polyMesh.H" +#include "addToRunTimeSelectionTable.H" +#include "treeBoundBox.H" +#include "treeDataFace.H" +#include "Time.H" +#include "meshTools.H" +//#include "Random.H" +// For 'facePoint' helper function only +#include "mappedPatchBase.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + defineTypeNameAndDebug(patchSeedSet, 0); + addToRunTimeSelectionTable(sampledSet, patchSeedSet, word); +} + + +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +void Foam::patchSeedSet::calcSamples +( + DynamicList& samplingPts, + DynamicList