Merge branch 'master' of /home/dm4/OpenFOAM/OpenFOAM-dev

This commit is contained in:
andy
2012-07-12 11:14:48 +01:00
59 changed files with 796 additions and 792 deletions

View File

@ -12,7 +12,4 @@
tmp<volScalarField> tkappa = thermo.kappa();
const volScalarField& kappa = tkappa();
//tmp<volSymmTensorField> tkappa = thermo.directionalKappa();
//const volSymmTensorField& kappa = tkappa();
volScalarField& h = thermo.he();

View File

@ -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
@ -123,7 +123,7 @@ void starMesh::createCoupleMatches()
cellRemovedFaces.insert
(
fp.masterCell(),
fp.masterFace()
SLList<label>(fp.masterFace())
);
}
else
@ -1362,7 +1362,7 @@ void starMesh::createCoupleMatches()
cellRemovedFaces.insert
(
fp.masterCell(),
fp.masterFace()
SLList<label>(fp.masterFace())
);
}
else
@ -1378,7 +1378,7 @@ void starMesh::createCoupleMatches()
cellRemovedFaces.insert
(
fp.slaveCell(),
fp.slaveFace()
SLList<label>(fp.slaveFace())
);
}
else

View File

@ -40,6 +40,7 @@ Description
#include "refinementFeatures.H"
#include "shellSurfaces.H"
#include "decompositionMethod.H"
#include "noDecomp.H"
#include "fvMeshDistribute.H"
#include "wallPolyPatch.H"
#include "refinementParameters.H"
@ -176,17 +177,28 @@ int main(int argc, char *argv[])
// Read decomposePar dictionary
IOdictionary decomposeDict
(
IOobject
(
"decomposeParDict",
runTime.system(),
mesh,
IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
);
dictionary decomposeDict;
{
if (Pstream::parRun())
{
decomposeDict = IOdictionary
(
IOobject
(
"decomposeParDict",
runTime.system(),
mesh,
IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
);
}
else
{
decomposeDict.add("method", "none");
decomposeDict.add("numberOfSubdomains", 1);
}
}
// Debug

View File

@ -95,11 +95,12 @@ FoamFile
// type hex; // hex/wedge/prism/pyr/tet/tetWedge/splitHex
// }
//
// // Cells with cell centre within box
// // Cells with cell centre within box ('box') or multiple boxes ('boxes')
// source boxToCell;
// sourceInfo
// {
// box (0 0 0) (1 1 1);
// //boxes ((0 0 0) (1 1 1) (10 10 10)(11 11 11));
// }
//
// // Cells with cell centre within box
@ -223,11 +224,12 @@ FoamFile
// name ".*Zone1"; // Name of faceZone, regular expressions allowed
// }
//
// // Faces with face centre within box
// // Faces with face centre within box ('box') or multiple boxes ('boxes')
// source boxToFace;
// sourceInfo
// {
// box (0 0 0) (1 1 1);
// //boxes ((0 0 0) (1 1 1) (10 10 10)(11 11 11));
// }
//
// // Faces with normal to within certain angle aligned with vector.
@ -295,11 +297,12 @@ FoamFile
// points ((0 0 0) (1 1 1));
// }
//
// // Points with coordinate within box
// // Points with coordinate within box ('box') or multiple boxes ('boxes')
// source boxToPoint;
// sourceInfo
// {
// box (0 0 0) (1 1 1);
// //boxes ((0 0 0) (1 1 1) (10 10 10)(11 11 11));
// }
//
// // Select based on surface

View File

@ -191,6 +191,22 @@ int main(int argc, char *argv[])
outputFieldList<tensor>(vtf, patchIDs[0]);
Info<< endl;
}
else
{
// No group.
forAll(patchIDs, i)
{
label patchI = patchIDs[i];
Info<< bm[patchI].type()
<< "\t: " << bm[patchI].name() << nl;
outputFieldList<scalar>(vsf, patchI);
outputFieldList<vector>(vvf, patchI);
outputFieldList<sphericalTensor>(vsptf, patchI);
outputFieldList<symmTensor>(vsytf, patchI);
outputFieldList<tensor>(vtf, patchI);
Info<< endl;
}
}
}
}
}

View File

@ -122,7 +122,8 @@ structuredCoeffs
patches (bottomPatch);
}
//// Is the case distributed
//// Is the case distributed? Note: command-line argument -roots takes
//// precedence
//distributed yes;
//// Per slave (so nProcs-1 entries) the directory above the case.
//roots

View File

@ -143,8 +143,6 @@ int main(int argc, char *argv[])
args
);
instantList masterTimeDirs = runTime.times();
if (timeDirs.empty())
{
FatalErrorIn(args.executable())
@ -152,6 +150,16 @@ int main(int argc, char *argv[])
<< exit(FatalError);
}
// Get current times if -newTimes
instantList masterTimeDirs;
if (newTimes)
{
masterTimeDirs = runTime.times();
}
# include "createNamedMesh.H"
word regionDir = word::null;
if (regionName != fvMesh::defaultRegion)
@ -176,11 +184,24 @@ int main(int argc, char *argv[])
// Loop over all times
forAll(timeDirs, timeI)
{
if (newTimes && findIndex(masterTimeDirs, timeDirs[timeI]) != -1)
if (newTimes)
{
Info<< "Skipping time " << timeDirs[timeI].name()
<< endl << endl;
continue;
// Compare on timeName, not value
bool foundTime = false;
forAll(masterTimeDirs, i)
{
if (masterTimeDirs[i].name() == timeDirs[timeI].name())
{
foundTime = true;
break;
}
}
if (foundTime)
{
Info<< "Skipping time " << timeDirs[timeI].name()
<< endl << endl;
continue;
}
}

View File

@ -63,294 +63,6 @@ Description
static const scalar defaultMergeTol = 1e-6;
//// Read mesh if available. Otherwise create empty mesh with same non-proc
//// patches as proc0 mesh. Requires all processors to have all patches
//// (and in same order).
//autoPtr<fvMesh> createMesh
//(
// const Time& runTime,
// const word& regionName,
// const fileName& instDir,
// const bool haveMesh
//)
//{
// //Pout<< "Create mesh for time = "
// // << runTime.timeName() << nl << endl;
//
// IOobject io
// (
// regionName,
// instDir,
// runTime,
// IOobject::MUST_READ
// );
//
// if (!haveMesh)
// {
// // Create dummy mesh. Only used on procs that don't have mesh.
// IOobject noReadIO(io);
// noReadIO.readOpt() = IOobject::NO_READ;
// fvMesh dummyMesh
// (
// noReadIO,
// xferCopy(pointField()),
// xferCopy(faceList()),
// xferCopy(labelList()),
// xferCopy(labelList()),
// false
// );
// // Add some dummy zones so upon reading it does not read them
// // from the undecomposed case. Should be done as extra argument to
// // regIOobject::readStream?
// List<pointZone*> pz
// (
// 1,
// new pointZone
// (
// "dummyPointZone",
// labelList(0),
// 0,
// dummyMesh.pointZones()
// )
// );
// List<faceZone*> fz
// (
// 1,
// new faceZone
// (
// "dummyFaceZone",
// labelList(0),
// boolList(0),
// 0,
// dummyMesh.faceZones()
// )
// );
// List<cellZone*> cz
// (
// 1,
// new cellZone
// (
// "dummyCellZone",
// labelList(0),
// 0,
// dummyMesh.cellZones()
// )
// );
// dummyMesh.addZones(pz, fz, cz);
// //Pout<< "Writing dummy mesh to " << dummyMesh.polyMesh::objectPath()
// // << endl;
// dummyMesh.write();
// }
//
// //Pout<< "Reading mesh from " << io.objectPath() << endl;
// autoPtr<fvMesh> meshPtr(new fvMesh(io));
// fvMesh& mesh = meshPtr();
//
//
// // Sync patches
// // ~~~~~~~~~~~~
//
// if (Pstream::master())
// {
// // Send patches
// for
// (
// int slave=Pstream::firstSlave();
// slave<=Pstream::lastSlave();
// slave++
// )
// {
// OPstream toSlave(Pstream::scheduled, slave);
// toSlave << mesh.boundaryMesh();
// }
// }
// else
// {
// // Receive patches
// IPstream fromMaster(Pstream::scheduled, Pstream::masterNo());
// PtrList<entry> patchEntries(fromMaster);
//
// if (haveMesh)
// {
// // Check master names against mine
//
// const polyBoundaryMesh& patches = mesh.boundaryMesh();
//
// forAll(patchEntries, patchI)
// {
// const entry& e = patchEntries[patchI];
// const word type(e.dict().lookup("type"));
// const word& name = e.keyword();
//
// if (type == processorPolyPatch::typeName)
// {
// break;
// }
//
// if (patchI >= patches.size())
// {
// FatalErrorIn
// (
// "createMesh(const Time&, const fileName&, const bool)"
// ) << "Non-processor patches not synchronised."
// << endl
// << "Processor " << Pstream::myProcNo()
// << " has only " << patches.size()
// << " patches, master has "
// << patchI
// << exit(FatalError);
// }
//
// if
// (
// type != patches[patchI].type()
// || name != patches[patchI].name()
// )
// {
// FatalErrorIn
// (
// "createMesh(const Time&, const fileName&, const bool)"
// ) << "Non-processor patches not synchronised."
// << endl
// << "Master patch " << patchI
// << " name:" << type
// << " type:" << type << endl
// << "Processor " << Pstream::myProcNo()
// << " patch " << patchI
// << " has name:" << patches[patchI].name()
// << " type:" << patches[patchI].type()
// << exit(FatalError);
// }
// }
// }
// else
// {
// // Add patch
// List<polyPatch*> patches(patchEntries.size());
// label nPatches = 0;
//
// forAll(patchEntries, patchI)
// {
// const entry& e = patchEntries[patchI];
// const word type(e.dict().lookup("type"));
// const word& name = e.keyword();
//
// if (type == processorPolyPatch::typeName)
// {
// break;
// }
//
// //Pout<< "Adding patch:" << nPatches
// // << " name:" << name << " type:" << type << endl;
//
// dictionary patchDict(e.dict());
// patchDict.remove("nFaces");
// patchDict.add("nFaces", 0);
// patchDict.remove("startFace");
// patchDict.add("startFace", 0);
//
// patches[patchI] = polyPatch::New
// (
// name,
// patchDict,
// nPatches++,
// mesh.boundaryMesh()
// ).ptr();
// }
// patches.setSize(nPatches);
// mesh.addFvPatches(patches, false); // no parallel comms
//
// //// Write empty mesh now we have correct patches
// //meshPtr().write();
// }
// }
//
//
// // Determine zones
// // ~~~~~~~~~~~~~~~
//
// wordList pointZoneNames(mesh.pointZones().names());
// Pstream::scatter(pointZoneNames);
// wordList faceZoneNames(mesh.faceZones().names());
// Pstream::scatter(faceZoneNames);
// wordList cellZoneNames(mesh.cellZones().names());
// Pstream::scatter(cellZoneNames);
//
// if (!haveMesh)
// {
// // Add the zones. Make sure to remove the old dummy ones first
// mesh.pointZones().clear();
// mesh.faceZones().clear();
// mesh.cellZones().clear();
//
// List<pointZone*> pz(pointZoneNames.size());
// forAll(pointZoneNames, i)
// {
// pz[i] = new pointZone
// (
// pointZoneNames[i],
// labelList(0),
// i,
// mesh.pointZones()
// );
// }
// List<faceZone*> fz(faceZoneNames.size());
// forAll(faceZoneNames, i)
// {
// fz[i] = new faceZone
// (
// faceZoneNames[i],
// labelList(0),
// boolList(0),
// i,
// mesh.faceZones()
// );
// }
// List<cellZone*> cz(cellZoneNames.size());
// forAll(cellZoneNames, i)
// {
// cz[i] = new cellZone
// (
// cellZoneNames[i],
// labelList(0),
// i,
// mesh.cellZones()
// );
// }
// mesh.addZones(pz, fz, cz);
// }
//
//
// if (!haveMesh)
// {
// // We created a dummy mesh file above. Delete it.
// //Pout<< "Removing dummy mesh " << io.objectPath() << endl;
// rmDir(io.objectPath());
// }
//
// // Force recreation of globalMeshData.
// mesh.clearOut();
// mesh.globalData();
//
//
// // Do some checks.
//
// // Check if the boundary definition is unique
// mesh.boundaryMesh().checkDefinition(true);
// // Check if the boundary processor patches are correct
// mesh.boundaryMesh().checkParallelSync(true);
// // Check names of zones are equal
// mesh.cellZones().checkDefinition(true);
// mesh.cellZones().checkParallelSync(true);
// mesh.faceZones().checkDefinition(true);
// mesh.faceZones().checkParallelSync(true);
// mesh.pointZones().checkDefinition(true);
// mesh.pointZones().checkParallelSync(true);
//
// return meshPtr;
//}
// Get merging distance when matching face centres
scalar getMergeDistance
(
@ -786,14 +498,6 @@ int main(int argc, char *argv[])
Info<< "Per processor mesh availability : " << haveMesh << endl;
const bool allHaveMesh = (findIndex(haveMesh, false) == -1);
// Create mesh
//autoPtr<fvMesh> meshPtr = createMesh
//(
// runTime,
// regionName,
// masterInstDir,
// haveMesh[Pstream::myProcNo()]
//);
autoPtr<fvMesh> meshPtr = loadOrCreateMesh
(
IOobject
@ -908,6 +612,9 @@ int main(int argc, char *argv[])
objects.erase(iter);
}
// volFields
PtrList<volScalarField> volScalarFields;
readFields
(
@ -958,6 +665,9 @@ int main(int argc, char *argv[])
volTensorFields
);
// surfaceFields
PtrList<surfaceScalarField> surfScalarFields;
readFields
(

View File

@ -3,4 +3,4 @@ autoPtr<solidThermo> thermo
solidThermo::New(mesh)
);
volScalarField& T = thermo->T();
const volScalarField& T = thermo->T();

View File

@ -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
@ -59,13 +59,13 @@ public:
{}
//- Construct given initial T
SLList(T a)
explicit SLList(T a)
:
LList<SLListBase, T>(a)
{}
//- Construct from Istream
SLList(Istream& is)
explicit SLList(Istream& is)
:
LList<SLListBase, T>(is)
{}

View File

@ -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
@ -63,10 +63,7 @@ void Foam::polyMesh::clearGeom()
primitiveMesh::clearGeom();
forAll(boundary_, patchI)
{
boundary_[patchI].clearGeom();
}
boundary_.clearGeom();
// Reset valid directions (could change with rotation)
geometricD_ = Vector<label>::zero;

View File

@ -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
@ -65,6 +65,12 @@ void Foam::polyPatch::updateMesh(PstreamBuffers&)
}
void Foam::polyPatch::clearGeom()
{
primitivePatch::clearGeom();
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::polyPatch::polyPatch

View File

@ -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
@ -116,6 +116,9 @@ protected:
//- Update of the patch topology
virtual void updateMesh(PstreamBuffers&);
//- Clear geometry
virtual void clearGeom();
public:
@ -338,7 +341,7 @@ public:
const labelList& meshEdges() const;
//- Clear addressing
void clearAddressing();
virtual void clearAddressing();
// Other patch operations

View File

@ -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
@ -75,6 +75,17 @@ class quaternion
public:
//- Component type
typedef scalar cmptType;
// Member constants
enum
{
rank = 1 // Rank of quaternion is 1
};
// Static data members
static const char* const typeName;
@ -109,6 +120,9 @@ public:
const scalar angleZ
);
//- Construct a quaternion from a rotation tensor
inline explicit quaternion(const tensor& rotationTensor);
//- Construct from Istream
quaternion(Istream&);

View File

@ -66,6 +66,81 @@ inline Foam::quaternion::quaternion
operator*=(quaternion(vector(0, 0, 1), angleZ));
}
inline Foam::quaternion::quaternion
(
const tensor& rotationTensor
)
{
scalar trace = rotationTensor.xx()
+ rotationTensor.yy()
+ rotationTensor.zz();
if (trace > 0)
{
scalar s = 0.5/Foam::sqrt(trace + 1.0);
w_ = 0.25/s;
v_[0] = (rotationTensor.zy() - rotationTensor.yz())*s;
v_[1] = (rotationTensor.xz() - rotationTensor.zx())*s;
v_[2] = (rotationTensor.yx() - rotationTensor.xy())*s;
}
else
{
if
(
rotationTensor.xx() > rotationTensor.yy()
&& rotationTensor.xx() > rotationTensor.zz()
)
{
scalar s = 2.0*Foam::sqrt
(
1.0
+ rotationTensor.xx()
- rotationTensor.yy()
- rotationTensor.zz()
);
w_ = (rotationTensor.zy() - rotationTensor.yz())/s;
v_[0] = 0.25*s;
v_[1] = (rotationTensor.xy() + rotationTensor.yx())/s;
v_[2] = (rotationTensor.xz() + rotationTensor.zx())/s;
}
else if
(
rotationTensor.yy() > rotationTensor.zz()
)
{
scalar s = 2.0*Foam::sqrt
(
1.0
+ rotationTensor.yy()
- rotationTensor.xx()
- rotationTensor.zz()
);
w_ = (rotationTensor.xz() - rotationTensor.xz())/s;
v_[0] = (rotationTensor.xy() + rotationTensor.yx())/s;
v_[1] = 0.25*s;
v_[2] = (rotationTensor.yz() + rotationTensor.zy())/s;
}
else
{
scalar s = 2.0*Foam::sqrt
(
1.0
+ rotationTensor.zz()
- rotationTensor.xx()
- rotationTensor.yy()
);
w_ = (rotationTensor.yx() - rotationTensor.xy())/s;
v_[0] = (rotationTensor.xz() + rotationTensor.zx())/s;
v_[1] = (rotationTensor.yz() + rotationTensor.zy())/s;
v_[2] = 0.25*s;
}
}
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //

View File

@ -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
@ -198,8 +198,7 @@ void Foam::interRegionHeatTransferModel::addSup
<< endl;
}
//SAF: temporarily output
if (mesh_.time().outputTime())
if (debug && mesh_.time().outputTime())
{
Tmapped.write();
htc_.write();

View File

@ -143,21 +143,7 @@ Foam::cyclicAMIFvPatchField<Type>::cyclicAMIFvPatchField
template<class Type>
bool Foam::cyclicAMIFvPatchField<Type>::coupled() const
{
if
(
Pstream::parRun()
|| (
this->cyclicAMIPatch_.size()
&& this->cyclicAMIPatch_.cyclicAMIPatch().neighbPatch().size()
)
)
{
return true;
}
else
{
return false;
}
return cyclicAMIPatch_.coupled();
}

View File

@ -503,6 +503,19 @@ public:
#endif
#define makeFvPatchField(fvPatchTypeField) \
\
defineNamedTemplateTypeNameAndDebug(fvPatchTypeField, 0); \
template<> \
int fvPatchTypeField::disallowGenericFvPatchField \
( \
debug::debugSwitch("disallowGenericFvPatchField", 0) \
); \
defineTemplateRunTimeSelectionTable(fvPatchTypeField, patch); \
defineTemplateRunTimeSelectionTable(fvPatchTypeField, patchMapper); \
defineTemplateRunTimeSelectionTable(fvPatchTypeField, dictionary);
#define addToPatchFieldRunTimeSelection(PatchTypeField, typePatchTypeField) \
addToRunTimeSelectionTable \
( \

View File

@ -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
@ -32,18 +32,6 @@ namespace Foam
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
#define makeFvPatchField(fvPatchTypeField) \
\
defineNamedTemplateTypeNameAndDebug(fvPatchTypeField, 0); \
template<> \
int fvPatchTypeField::disallowGenericFvPatchField \
( \
debug::debugSwitch("disallowGenericFvPatchField", 0) \
); \
defineTemplateRunTimeSelectionTable(fvPatchTypeField, patch); \
defineTemplateRunTimeSelectionTable(fvPatchTypeField, patchMapper); \
defineTemplateRunTimeSelectionTable(fvPatchTypeField, dictionary);
makeFvPatchField(fvPatchScalarField)
makeFvPatchField(fvPatchVectorField)
makeFvPatchField(fvPatchSphericalTensorField)

View File

@ -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
@ -85,7 +85,7 @@ public:
gradScheme<Type>(mesh),
minDet_(readScalar(schemeData))
{
if (minDet_ < 0 || minDet_ > 8)
if (minDet_ < 0) //-for facearea weighted: || minDet_ > 8)
{
FatalIOErrorIn
(
@ -93,7 +93,7 @@ public:
"(const fvMesh&, Istream& schemeData)",
schemeData
) << "Minimum determinant = " << minDet_
<< " should be >= 0 and <= 8"
<< " should be >= 0" // and <= 8"
<< exit(FatalIOError);
}
}

View File

@ -110,6 +110,38 @@ void Foam::extendedLeastSquaresVectors::makeLeastSquaresVectors() const
const labelUList& owner = mesh_.owner();
const labelUList& neighbour = mesh_.neighbour();
// Determine number of dimensions and (for 2D) missing dimension
label nDims = 0;
label twoD = -1;
for (direction dir = 0; dir < vector::nComponents; dir++)
{
if (mesh.geometricD()[dir] == 1)
{
nDims++;
}
else
{
twoD = dir;
}
}
if (nDims == 1)
{
FatalErrorIn
(
"extendedLeastSquaresVectors::makeLeastSquaresVectors() const"
) << "Found a mesh with only one geometric dimension : "
<< mesh.geometricD()
<< exit(FatalError);
}
else if (nDims == 2)
{
Info<< "extendedLeastSquares : detected " << nDims
<< " valid directions. Missing direction " << twoD << endl;
}
const volVectorField& C = mesh.C();
// Set up temporary storage for the dd tensor (before inversion)
@ -122,7 +154,7 @@ void Foam::extendedLeastSquaresVectors::makeLeastSquaresVectors() const
vector d = C[nei] - C[own];
const symmTensor wdd(1.0/magSqr(d[facei])*sqr(d[facei]));
const symmTensor wdd(1.0/magSqr(d)*sqr(d));
dd[own] += wdd;
dd[nei] += wdd;
@ -147,12 +179,35 @@ void Foam::extendedLeastSquaresVectors::makeLeastSquaresVectors() const
}
}
// Check for missing dimensions
// Add the missing eigenvector (such that it does not
// affect the determinant)
if (nDims == 2)
{
forAll(dd, cellI)
{
if (twoD == 0)
{
dd[cellI].xx() = 1;
}
else if (twoD == 1)
{
dd[cellI].yy() = 1;
}
else
{
dd[cellI].zz() = 1;
}
}
}
scalarField detdd(det(dd));
Info<< "max(detdd) = " << max(detdd) << nl
<< "min(detdd) = " << min(detdd) << nl
<< "average(detdd) = " << average(detdd) << endl;
label nAdaptedCells = 0;
label nAddCells = 0;
label maxNaddCells = 4*detdd.size();
additionalCellsPtr_ = new List<labelPair>(maxNaddCells);
@ -162,6 +217,8 @@ void Foam::extendedLeastSquaresVectors::makeLeastSquaresVectors() const
{
label count = 0;
label oldNAddCells = nAddCells;
while (++count < 100 && detdd[i] < minDet_)
{
if (nAddCells == maxNaddCells)
@ -170,7 +227,8 @@ void Foam::extendedLeastSquaresVectors::makeLeastSquaresVectors() const
(
"extendedLeastSquaresVectors::"
"makeLeastSquaresVectors() const"
) << "nAddCells exceeds maxNaddCells"
) << "nAddCells exceeds maxNaddCells ("
<< maxNaddCells << ")"
<< exit(FatalError);
}
@ -188,20 +246,35 @@ void Foam::extendedLeastSquaresVectors::makeLeastSquaresVectors() const
if (cellj != i)
{
if (cellj != -1)
vector dCij = (mesh.C()[cellj] - mesh.C()[i]);
symmTensor ddij =
dd[i] + (1.0/magSqr(dCij))*sqr(dCij);
// Add the missing eigenvector (such that it does not
// affect the determinant)
if (nDims == 2)
{
vector dCij = (mesh.C()[cellj] - mesh.C()[i]);
symmTensor ddij =
dd[i] + (1.0/magSqr(dCij))*sqr(dCij);
scalar detddij = det(ddij);
if (detddij > maxDetddij)
if (twoD == 0)
{
addCell = cellj;
maxDetddij = detddij;
ddij.xx() = 1;
}
else if (twoD == 1)
{
ddij.yy() = 1;
}
else
{
ddij.zz() = 1;
}
}
scalar detddij = det(ddij);
if (detddij > maxDetddij)
{
addCell = cellj;
maxDetddij = detddij;
}
}
}
@ -213,17 +286,50 @@ void Foam::extendedLeastSquaresVectors::makeLeastSquaresVectors() const
additionalCells_[nAddCells++][1] = addCell;
vector dCij = mesh.C()[addCell] - mesh.C()[i];
dd[i] += (1.0/magSqr(dCij))*sqr(dCij);
// Add the missing eigenvector (such that it does not
// affect the determinant)
if (nDims == 2)
{
if (twoD == 0)
{
dd[i].xx() = 1;
}
else if (twoD == 1)
{
dd[i].yy() = 1;
}
else
{
dd[i].zz() = 1;
}
}
detdd[i] = det(dd[i]);
}
}
if (oldNAddCells < nAddCells)
{
nAdaptedCells++;
}
}
additionalCells_.setSize(nAddCells);
Info<< "max(detdd) = " << max(detdd) << nl
<< "min(detdd) = " << min(detdd) << nl
<< "average(detdd) = " << average(detdd) << nl
<< "nAddCells/nCells = " << scalar(nAddCells)/mesh.nCells() << endl;
reduce(nAddCells, sumOp<label>());
reduce(nAdaptedCells, sumOp<label>());
if (nAddCells)
{
Info<< "max(detdd) = " << max(detdd) << nl
<< "min(detdd) = " << min(detdd) << nl
<< "average(detdd) = " << average(detdd) << nl
<< "nAdapted/nCells = "
<< scalar(nAdaptedCells)/mesh.globalData().nTotalCells() << nl
<< "nAddCells/nCells = "
<< scalar(nAddCells)/mesh.globalData().nTotalCells()
<< endl;
}
// Invert the dd tensor
const symmTensorField invDd(inv(dd));
@ -237,11 +343,8 @@ void Foam::extendedLeastSquaresVectors::makeLeastSquaresVectors() const
vector d = C[nei] - C[own];
lsP[facei] =
(1.0/magSqr(d[facei]))*(invDd[owner[facei]] & d);
lsN[facei] =
((-1.0)/magSqr(d[facei]))*(invDd[neighbour[facei]] & d);
lsP[facei] = (1.0/magSqr(d))*(invDd[own] & d);
lsN[facei] = ((-1.0)/magSqr(d))*(invDd[nei] & d);
}
forAll(blsP, patchI)

View File

@ -142,8 +142,8 @@ class fvMatrix
mutable GeometricField<Type, fvsPatchField, surfaceMesh>
*faceFluxCorrectionPtr_;
// ***HGW for testing LduMatrix protected:
public:
protected:
//- Declare friendship with the fvSolver class
friend class fvSolver;

View File

@ -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
@ -39,60 +39,82 @@ namespace Foam
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
bool Foam::cyclicAMIFvPatch::coupled() const
{
return Pstream::parRun() || (this->size() && neighbFvPatch().size());
}
void Foam::cyclicAMIFvPatch::makeWeights(scalarField& w) const
{
const cyclicAMIFvPatch& nbrPatch = neighbFvPatch();
const scalarField deltas(nf() & fvPatch::delta());
const scalarField nbrDeltas
(
interpolate(nbrPatch.nf() & nbrPatch.fvPatch::delta())
);
forAll(deltas, faceI)
if (coupled())
{
scalar di = deltas[faceI];
scalar dni = nbrDeltas[faceI];
const cyclicAMIFvPatch& nbrPatch = neighbFvPatch();
w[faceI] = dni/(di + dni);
const scalarField deltas(nf() & fvPatch::delta());
const scalarField nbrDeltas
(
interpolate(nbrPatch.nf() & nbrPatch.fvPatch::delta())
);
forAll(deltas, faceI)
{
scalar di = deltas[faceI];
scalar dni = nbrDeltas[faceI];
w[faceI] = dni/(di + dni);
}
}
else
{
// Behave as uncoupled patch
fvPatch::makeWeights(w);
}
}
Foam::tmp<Foam::vectorField> Foam::cyclicAMIFvPatch::delta() const
{
const vectorField patchD(fvPatch::delta());
const cyclicAMIFvPatch& nbrPatch = neighbFvPatch();
const vectorField nbrPatchD(interpolate(nbrPatch.fvPatch::delta()));
tmp<vectorField> tpdv(new vectorField(patchD.size()));
vectorField& pdv = tpdv();
// do the transformation if necessary
if (parallel())
if (coupled())
{
forAll(patchD, faceI)
{
const vector& ddi = patchD[faceI];
const vector& dni = nbrPatchD[faceI];
const vectorField patchD(fvPatch::delta());
pdv[faceI] = ddi - dni;
const vectorField nbrPatchD(interpolate(nbrPatch.fvPatch::delta()));
tmp<vectorField> tpdv(new vectorField(patchD.size()));
vectorField& pdv = tpdv();
// do the transformation if necessary
if (parallel())
{
forAll(patchD, faceI)
{
const vector& ddi = patchD[faceI];
const vector& dni = nbrPatchD[faceI];
pdv[faceI] = ddi - dni;
}
}
else
{
forAll(patchD, faceI)
{
const vector& ddi = patchD[faceI];
const vector& dni = nbrPatchD[faceI];
pdv[faceI] = ddi - transform(forwardT()[0], dni);
}
}
return tpdv;
}
else
{
forAll(patchD, faceI)
{
const vector& ddi = patchD[faceI];
const vector& dni = nbrPatchD[faceI];
pdv[faceI] = ddi - transform(forwardT()[0], dni);
}
return fvPatch::delta();
}
return tpdv;
}

View File

@ -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
@ -146,6 +146,11 @@ public:
);
}
//- Return true if this patch is coupled. This is equivalent
// to the coupledPolyPatch::coupled() if parallel running or
// both sides present, false otherwise
virtual bool coupled() const;
//- Return delta (P to N) vectors across coupled patch
virtual tmp<vectorField> delta() const;

View File

@ -165,7 +165,7 @@ public:
}
//- Return true if this patch is coupled
bool coupled() const
virtual bool coupled() const
{
return polyPatch_.coupled();
}

View File

@ -965,6 +965,13 @@ void Foam::AMIInterpolation<SourcePatch, TargetPatch>::calcAddressing
label tgtFaceI
)
{
// Pre-size to handle early exit
srcAddress_.setSize(srcPatch.size());
srcWeights_.setSize(srcPatch.size());
tgtAddress_.setSize(tgtPatch.size());
tgtWeights_.setSize(tgtPatch.size());
if (debug && (!srcPatch.size() || !tgtPatch.size()))
{
Pout<< "AMI: Patches not on processor: Source faces = "
@ -1134,16 +1141,11 @@ void Foam::AMIInterpolation<SourcePatch, TargetPatch>::calcAddressing
}
// transfer data to persistent storage
srcAddress_.setSize(srcPatch.size());
srcWeights_.setSize(srcPatch.size());
forAll(srcAddr, i)
{
srcAddress_[i].transfer(srcAddr[i]);
srcWeights_[i].transfer(srcWght[i]);
}
tgtAddress_.setSize(tgtPatch.size());
tgtWeights_.setSize(tgtPatch.size());
forAll(tgtAddr, i)
{
tgtAddress_[i].transfer(tgtAddr[i]);

View File

@ -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
@ -208,7 +208,7 @@ void Foam::cyclicAMIPolyPatch::calcTransforms
{
if (debug)
{
Pout<< " patch:" << name()
Pout<< "patch:" << name()
<< " Assuming cyclic AMI pairs are colocated" << endl;
}
@ -282,6 +282,16 @@ void Foam::cyclicAMIPolyPatch::resetAMI() const
AMIReverse_
)
);
if (debug)
{
Pout<< "cyclicAMIPolyPatch : " << name()
<< " constructed AMI with " << nl
<< " " << ":srcAddress:" << AMIPtr_().srcAddress().size()
<< nl
<< " " << " tgAddress :" << AMIPtr_().tgtAddress().size()
<< nl << endl;
}
}
}
@ -345,6 +355,13 @@ void Foam::cyclicAMIPolyPatch::updateMesh(PstreamBuffers& pBufs)
}
void Foam::cyclicAMIPolyPatch::clearGeom()
{
AMIPtr_.clear();
polyPatch::clearGeom();
}
// * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * * * //
Foam::cyclicAMIPolyPatch::cyclicAMIPolyPatch
@ -645,16 +662,6 @@ const Foam::AMIPatchToPatchInterpolation& Foam::cyclicAMIPolyPatch::AMI() const
resetAMI();
}
if (debug)
{
Pout<< "cyclicAMIPolyPatch : " << name()
<< " constructed AMI with " << endl
<< " " << ":srcAddress:" << AMIPtr_().srcAddress().size() << endl
<< " " << " tgAddress :" << AMIPtr_().tgtAddress().size() << endl
<< endl;
}
return AMIPtr_();
}

View File

@ -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
@ -141,6 +141,9 @@ protected:
//- Update of the patch topology
virtual void updateMesh(PstreamBuffers&);
//- Clear geometry
virtual void clearGeom();
public:

View File

@ -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
@ -814,7 +814,27 @@ Foam::FaceCellWave<Type, TrackingData>::FaceCellWave
nEvals_(0),
nUnvisitedCells_(mesh_.nCells()),
nUnvisitedFaces_(mesh_.nFaces())
{}
{
if
(
allFaceInfo.size() != mesh_.nFaces()
|| allCellInfo.size() != mesh_.nCells()
)
{
FatalErrorIn
(
"FaceCellWave<Type, TrackingData>::FaceCellWave"
"(const polyMesh&, const labelList&, const List<Type>,"
" UList<Type>&, UList<Type>&, const label maxIter)"
) << "face and cell storage not the size of mesh faces, cells:"
<< endl
<< " allFaceInfo :" << allFaceInfo.size() << endl
<< " mesh_.nFaces():" << mesh_.nFaces() << endl
<< " allCellInfo :" << allCellInfo.size() << endl
<< " mesh_.nCells():" << mesh_.nCells()
<< exit(FatalError);
}
}
// Iterate, propagating changedFacesInfo across mesh, until no change (or
@ -850,6 +870,26 @@ Foam::FaceCellWave<Type, TrackingData>::FaceCellWave
nUnvisitedCells_(mesh_.nCells()),
nUnvisitedFaces_(mesh_.nFaces())
{
if
(
allFaceInfo.size() != mesh_.nFaces()
|| allCellInfo.size() != mesh_.nCells()
)
{
FatalErrorIn
(
"FaceCellWave<Type, TrackingData>::FaceCellWave"
"(const polyMesh&, const labelList&, const List<Type>,"
" UList<Type>&, UList<Type>&, const label maxIter)"
) << "face and cell storage not the size of mesh faces, cells:"
<< endl
<< " allFaceInfo :" << allFaceInfo.size() << endl
<< " mesh_.nFaces():" << mesh_.nFaces() << endl
<< " allCellInfo :" << allCellInfo.size() << endl
<< " mesh_.nCells():" << mesh_.nCells()
<< exit(FatalError);
}
// Copy initial changed faces data
setFaceInfo(changedFaces, changedFacesInfo);

View File

@ -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
@ -58,9 +58,13 @@ void Foam::boxToCell::combine(topoSet& set, const bool add) const
forAll(ctrs, cellI)
{
if (bb_.contains(ctrs[cellI]))
forAll(bbs_, i)
{
addOrDelete(set, cellI, add);
if (bbs_[i].contains(ctrs[cellI]))
{
addOrDelete(set, cellI, add);
break;
}
}
}
}
@ -72,11 +76,11 @@ void Foam::boxToCell::combine(topoSet& set, const bool add) const
Foam::boxToCell::boxToCell
(
const polyMesh& mesh,
const treeBoundBox& bb
const treeBoundBoxList& bbs
)
:
topoSetSource(mesh),
bb_(bb)
bbs_(bbs)
{}
@ -88,7 +92,12 @@ Foam::boxToCell::boxToCell
)
:
topoSetSource(mesh),
bb_(dict.lookup("box"))
bbs_
(
dict.found("box")
? treeBoundBoxList(1, treeBoundBox(dict.lookup("box")))
: dict.lookup("boxes")
)
{}
@ -100,7 +109,7 @@ Foam::boxToCell::boxToCell
)
:
topoSetSource(mesh),
bb_(checkIs(is))
bbs_(1, treeBoundBox(checkIs(is)))
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
@ -119,13 +128,13 @@ void Foam::boxToCell::applyToSet
{
if ((action == topoSetSource::NEW) || (action == topoSetSource::ADD))
{
Info<< " Adding cells with center within box " << bb_ << endl;
Info<< " Adding cells with center within boxes " << bbs_ << endl;
combine(set, true);
}
else if (action == topoSetSource::DELETE)
{
Info<< " Removing cells with center within box " << bb_ << endl;
Info<< " Removing cells with center within boxes " << bbs_ << endl;
combine(set, false);
}

View File

@ -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
@ -25,7 +25,7 @@ Class
Foam::boxToCell
Description
A topoSetSource to select cells based on cell centres inside box.
A topoSetSource to select cells based on cell centres inside box(es).
SourceFiles
boxToCell.C
@ -36,7 +36,7 @@ SourceFiles
#define boxToCell_H
#include "topoSetSource.H"
#include "treeBoundBox.H"
#include "treeBoundBoxList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -59,7 +59,7 @@ class boxToCell
//- bounding box.
treeBoundBox bb_;
treeBoundBoxList bbs_;
// Private Member Functions
@ -78,7 +78,7 @@ public:
boxToCell
(
const polyMesh& mesh,
const treeBoundBox& bb
const treeBoundBoxList& bbs
);
//- Construct from dictionary

View File

@ -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
@ -58,9 +58,13 @@ void Foam::boxToFace::combine(topoSet& set, const bool add) const
forAll(ctrs, faceI)
{
if (bb_.contains(ctrs[faceI]))
forAll(bbs_, i)
{
addOrDelete(set, faceI, add);
if (bbs_[i].contains(ctrs[faceI]))
{
addOrDelete(set, faceI, add);
break;
}
}
}
}
@ -72,11 +76,11 @@ void Foam::boxToFace::combine(topoSet& set, const bool add) const
Foam::boxToFace::boxToFace
(
const polyMesh& mesh,
const treeBoundBox& bb
const treeBoundBoxList& bbs
)
:
topoSetSource(mesh),
bb_(bb)
bbs_(bbs)
{}
@ -88,7 +92,12 @@ Foam::boxToFace::boxToFace
)
:
topoSetSource(mesh),
bb_(dict.lookup("box"))
bbs_
(
dict.found("box")
? treeBoundBoxList(1, treeBoundBox(dict.lookup("box")))
: dict.lookup("boxes")
)
{}
@ -100,7 +109,7 @@ Foam::boxToFace::boxToFace
)
:
topoSetSource(mesh),
bb_(checkIs(is))
bbs_(1, treeBoundBox(checkIs(is)))
{}
@ -120,13 +129,13 @@ void Foam::boxToFace::applyToSet
{
if ((action == topoSetSource::NEW) || (action == topoSetSource::ADD))
{
Info<< " Adding faces with centre within box " << bb_ << endl;
Info<< " Adding faces with centre within boxes " << bbs_ << endl;
combine(set, true);
}
else if (action == topoSetSource::DELETE)
{
Info<< " Removing faces with centre within box " << bb_ << endl;
Info<< " Removing faces with centre within boxes " << bbs_ << endl;
combine(set, false);
}

View File

@ -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
@ -36,7 +36,7 @@ SourceFiles
#define boxToFace_H
#include "topoSetSource.H"
#include "treeBoundBox.H"
#include "treeBoundBoxList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -58,7 +58,7 @@ class boxToFace
static addToUsageTable usage_;
//- bounding box.
treeBoundBox bb_;
treeBoundBoxList bbs_;
// Private Member Functions
@ -77,7 +77,7 @@ public:
boxToFace
(
const polyMesh& mesh,
const treeBoundBox& bb
const treeBoundBoxList& bbs
);
//- Construct from dictionary

View File

@ -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
@ -58,9 +58,12 @@ void Foam::boxToPoint::combine(topoSet& set, const bool add) const
forAll(pts, pointI)
{
if (bb_.contains(pts[pointI]))
forAll(bbs_, i)
{
addOrDelete(set, pointI, add);
if (bbs_[i].contains(pts[pointI]))
{
addOrDelete(set, pointI, add);
}
}
}
}
@ -72,11 +75,11 @@ void Foam::boxToPoint::combine(topoSet& set, const bool add) const
Foam::boxToPoint::boxToPoint
(
const polyMesh& mesh,
const treeBoundBox& bb
const treeBoundBoxList& bbs
)
:
topoSetSource(mesh),
bb_(bb)
bbs_(bbs)
{}
@ -88,7 +91,12 @@ Foam::boxToPoint::boxToPoint
)
:
topoSetSource(mesh),
bb_(dict.lookup("box"))
bbs_
(
dict.found("box")
? treeBoundBoxList(1, treeBoundBox(dict.lookup("box")))
: dict.lookup("boxes")
)
{}
@ -100,7 +108,7 @@ Foam::boxToPoint::boxToPoint
)
:
topoSetSource(mesh),
bb_(checkIs(is))
bbs_(1, treeBoundBox(checkIs(is)))
{}
@ -120,14 +128,14 @@ void Foam::boxToPoint::applyToSet
{
if ((action == topoSetSource::NEW) || (action == topoSetSource::ADD))
{
Info<< " Adding points that are within box " << bb_ << " ..."
Info<< " Adding points that are within boxes " << bbs_ << " ..."
<< endl;
combine(set, true);
}
else if (action == topoSetSource::DELETE)
{
Info<< " Removing points that are within box " << bb_ << " ..."
Info<< " Removing points that are within boxes " << bbs_ << " ..."
<< endl;
combine(set, false);

View File

@ -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
@ -36,7 +36,7 @@ SourceFiles
#define boxToPoint_H
#include "topoSetSource.H"
#include "treeBoundBox.H"
#include "treeBoundBoxList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -58,7 +58,7 @@ class boxToPoint
static addToUsageTable usage_;
//- bounding box.
treeBoundBox bb_;
treeBoundBoxList bbs_;
// Private Member Functions
@ -77,7 +77,7 @@ public:
boxToPoint
(
const polyMesh& mesh,
const treeBoundBox& bb
const treeBoundBoxList& bb
);
//- Construct from dictionary

View File

@ -6,5 +6,6 @@ manualDecomp/manualDecomp.C
multiLevelDecomp/multiLevelDecomp.C
structuredDecomp/topoDistanceData.C
structuredDecomp/structuredDecomp.C
noDecomp/noDecomp.C
LIB = $(FOAM_LIBBIN)/libdecompositionMethods

View File

@ -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
@ -111,7 +111,7 @@ public:
notImplemented
(
"decompose(const labelListList&, const pointField&"
", const scalarField)"
", const scalarField&)"
);
return labelList(0);
}

View File

@ -0,0 +1,53 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "noDecomp.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
defineTypeName(noDecomp);
addNamedToRunTimeSelectionTable
(
decompositionMethod,
noDecomp,
dictionary,
none
);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::noDecomp::noDecomp(const dictionary& decompositionDict)
:
decompositionMethod(decompositionDict)
{}
// ************************************************************************* //

View File

@ -0,0 +1,134 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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 <http://www.gnu.org/licenses/>.
Class
Foam::noDecomp
Description
Dummy decomposition method
SourceFiles
noDecomp.C
\*---------------------------------------------------------------------------*/
#ifndef noDecomp_H
#define noDecomp_H
#include "decompositionMethod.H"
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class noDecomp Declaration
\*---------------------------------------------------------------------------*/
class noDecomp
:
public decompositionMethod
{
// Private Member Functions
//- Disallow default bitwise copy construct and assignment
void operator=(const noDecomp&);
noDecomp(const noDecomp&);
public:
//- Runtime type information
TypeName("noDecomp");
// Constructors
//- Construct given the decomposition dictionary
noDecomp(const dictionary& decompositionDict);
//- Destructor
virtual ~noDecomp()
{}
// Member Functions
//- manual decompose does not care about proc boundaries - is all
// up to the user.
virtual bool parallelAware() const
{
return false;
}
//- Return for every coordinate the wanted processor number. Use the
// mesh connectivity (if needed)
virtual labelList decompose
(
const polyMesh& mesh,
const pointField& cc,
const scalarField& cWeights
)
{
notImplemented
(
"decompose(const polyMesh&, const pointField&"
", const scalarField&)"
);
return labelList(0);
}
//- Return for every coordinate the wanted processor number. Explicitly
// provided connectivity - does not use mesh_.
// The connectivity is equal to mesh.cellCells() except for
// - in parallel the cell numbers are global cell numbers (starting
// from 0 at processor0 and then incrementing all through the
// processors)
// - the connections are across coupled patches
virtual labelList decompose
(
const labelListList& globalCellCells,
const pointField& cc,
const scalarField& cWeights
)
{
notImplemented
(
"decompose(const labelListList&, const pointField&"
", const scalarField&)"
);
return labelList(0);
}
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -401,10 +401,10 @@ Foam::label Foam::ptscotchDecomp::decompose
}
// Dump graph
if (decompositionDict_.found("ptscotchCoeffs"))
if (decompositionDict_.found("scotchCoeffs"))
{
const dictionary& scotchCoeffs =
decompositionDict_.subDict("ptscotchCoeffs");
decompositionDict_.subDict("scotchCoeffs");
if (scotchCoeffs.lookupOrDefault("writeGraph", false))
{

View File

@ -73,16 +73,16 @@ void Foam::fieldMinMax::calcMinMaxFields
Pstream::gatherList(maxVs);
Pstream::gatherList(maxCs);
label minI = findMin(minVs);
scalar minValue = minVs[minI];
const vector& minC = minCs[minI];
label maxI = findMax(maxVs);
scalar maxValue = maxVs[maxI];
const vector& maxC = maxCs[maxI];
if (Pstream::master())
{
label minI = findMin(minVs);
scalar minValue = minVs[minI];
const vector& minC = minCs[minI];
label maxI = findMax(maxVs);
scalar maxValue = maxVs[maxI];
const vector& maxC = maxCs[maxI];
if (write_)
{
fieldMinMaxFilePtr_()
@ -153,17 +153,16 @@ void Foam::fieldMinMax::calcMinMaxFields
Pstream::gatherList(maxVs);
Pstream::gatherList(maxCs);
label minI = findMin(minVs);
Type minValue = minVs[minI];
const vector& minC = minCs[minI];
label maxI = findMax(maxVs);
Type maxValue = maxVs[maxI];
const vector& maxC = maxCs[maxI];
if (Pstream::master())
{
label minI = findMin(minVs);
Type minValue = minVs[minI];
const vector& minC = minCs[minI];
label maxI = findMax(maxVs);
Type maxValue = maxVs[maxI];
const vector& maxC = maxCs[maxI];
if (write_)
{
fieldMinMaxFilePtr_()

View File

@ -349,7 +349,7 @@ reactingOneDim::reactingOneDim(const word& modelType, const fvMesh& mesh)
pyrolysisModel(modelType, mesh),
solidChemistry_(solidChemistryModel::New(regionMesh())),
solidThermo_(solidChemistry_->solid()),
rho_(solidThermo_.rhos()),
rho_(solidThermo_.rho()),
Ys_(solidThermo_.composition().Y()),
h_(solidThermo_.he()),
primaryRadFluxName_(coeffs().lookupOrDefault<word>("radFluxName", "Qr")),
@ -449,7 +449,7 @@ reactingOneDim::reactingOneDim
pyrolysisModel(modelType, mesh, dict),
solidChemistry_(solidChemistryModel::New(regionMesh())),
solidThermo_(solidChemistry_->solid()),
rho_(solidThermo_.rhos()),
rho_(solidThermo_.rho()),
Ys_(solidThermo_.composition().Y()),
h_(solidThermo_.he()),
primaryRadFluxName_(dict.lookupOrDefault<word>("radFluxName", "Qr")),

View File

@ -359,7 +359,7 @@ void thermoBaffle2D::info() const
(
mag(regionMesh().Sf().boundaryField()[patchI])
* ph.snGrad()
* thermo_->alpha(patchI)
* thermo_->alpha().boundaryField()[patchI]
) << endl;
}
}

View File

@ -171,13 +171,15 @@ void Foam::meshToMesh::calcAddressing()
wallBb.max() + vector(typDim, typDim, typDim)
);
// Note: allow more levels than in meshSearch. Assume patch
// is not as big as all boundary faces
indexedOctree<treeDataFace> oc
(
treeDataFace(false, fromPatch),
shiftedBb, // overall search domain
8, // maxLevel
12, // maxLevel
10, // leafsize
3.0 // duplicity
6.0 // duplicity
);
const vectorField::subField centresToBoundary =
@ -185,7 +187,7 @@ void Foam::meshToMesh::calcAddressing()
boundaryAddressing_[patchi].setSize(toPatch.size());
scalar distSqr = sqr(GREAT);
scalar distSqr = sqr(wallBb.mag());
forAll(toPatch, toi)
{

View File

@ -40,62 +40,7 @@ namespace Foam
defineTypeNameAndDebug(basicThermo, 0);
defineRunTimeSelectionTable(basicThermo, fvMesh);
}
/*
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
Foam::wordList Foam::basicThermo::heBoundaryTypes()
{
const volScalarField::GeometricBoundaryField& tbf = T_.boundaryField();
wordList hbt = tbf.types();
forAll(tbf, patchi)
{
if (isA<fixedValueFvPatchScalarField>(tbf[patchi]))
{
hbt[patchi] = fixedEnergyFvPatchScalarField::typeName;
}
else if
(
isA<zeroGradientFvPatchScalarField>(tbf[patchi])
|| isA<fixedGradientFvPatchScalarField>(tbf[patchi])
)
{
hbt[patchi] = gradientEnergyFvPatchScalarField::typeName;
}
else if(isA<mixedFvPatchScalarField>(tbf[patchi]))
{
hbt[patchi] = mixedEnergyFvPatchScalarField::typeName;
}
else if (isA<temperatureJumpFvPatchScalarField>(tbf[patchi]))
{
hbt[patchi] = energyJumpFvPatchScalarField::typeName;
}
}
return hbt;
}
void Foam::basicThermo::heBoundaryCorrection(volScalarField& h)
{
volScalarField::GeometricBoundaryField& hbf = h.boundaryField();
forAll(hbf, patchi)
{
if (isA<gradientEnergyFvPatchScalarField>(hbf[patchi]))
{
refCast<gradientEnergyFvPatchScalarField>(hbf[patchi]).gradient()
= hbf[patchi].fvPatchField::snGrad();
}
else if (isA<mixedEnergyFvPatchScalarField>(hbf[patchi]))
{
refCast<mixedEnergyFvPatchScalarField>(hbf[patchi]).refGrad()
= hbf[patchi].fvPatchField::snGrad();
}
}
}
*/
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //

View File

@ -55,6 +55,25 @@ Foam::rhoThermo::rhoThermo(const fvMesh& mesh)
{}
Foam::rhoThermo::rhoThermo(const fvMesh& mesh, const dictionary& dict)
:
basicThermo(mesh, dict),
rho_
(
IOobject
(
"rhoThermo",
mesh.time().timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh,
dimDensity
)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::rhoThermo::~rhoThermo()

View File

@ -90,6 +90,9 @@ public:
//- Construct from mesh
rhoThermo(const fvMesh&);
//- Construct from mesh
rhoThermo(const fvMesh&, const dictionary&);
//- Selector
static autoPtr<rhoThermo> New(const fvMesh&);

View File

@ -89,9 +89,6 @@ public:
// Derived thermal properties
//- Isotropic thermal conductivity [W/m/K]
//virtual tmp<volScalarField> kappa() const;
//- Anisotropic thermal conductivity [W/m/K]
virtual tmp<volVectorField> Kappa() const;

View File

@ -35,6 +35,7 @@ namespace Foam
defineRunTimeSelectionTable(solidReactionThermo, dictionary);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::solidReactionThermo::solidReactionThermo(const fvMesh& mesh)
@ -52,6 +53,7 @@ Foam::solidReactionThermo::solidReactionThermo
solidThermo(mesh, dict)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::solidReactionThermo::~solidReactionThermo()

View File

@ -42,20 +42,7 @@ namespace Foam
Foam::solidThermo::solidThermo(const fvMesh& mesh)
:
basicThermo(mesh),
rho_
(
IOobject
(
"rho",
mesh.time().timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh,
dimMass/dimVolume
)
rhoThermo(mesh)
{}
@ -65,20 +52,7 @@ Foam::solidThermo::solidThermo
const dictionary& dict
)
:
basicThermo(mesh, dict),
rho_
(
IOobject
(
"rho",
mesh.time().timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh,
dimMass/dimVolume
)
rhoThermo(mesh, dict)
{}
@ -90,57 +64,10 @@ Foam::solidThermo::~solidThermo()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::volScalarField& Foam::solidThermo::T()
{
return this->T_;
}
const Foam::volScalarField& Foam::solidThermo::T() const
{
return this->T_;
}
const Foam::volScalarField& Foam::solidThermo::rhos() const
{
return rho_;
}
Foam::volScalarField& Foam::solidThermo::rhos()
{
return rho_;
}
const Foam::volScalarField& Foam::solidThermo::p() const
{
return this->p_;
}
Foam::volScalarField& Foam::solidThermo::p()
{
return this->p_;
}
const Foam::volScalarField& Foam::solidThermo::alpha() const
{
return this->alpha_;
}
Foam::tmp<Foam::volScalarField> Foam::solidThermo::rho() const
{
return tmp<volScalarField>(rho_);
}
bool Foam::solidThermo::read()
{
return regIOobject::read();
}
// ************************************************************************* //

View File

@ -41,7 +41,7 @@ SourceFiles
#include "IOdictionary.H"
#include "autoPtr.H"
#include "basicSolidMixture.H"
#include "basicThermo.H"
#include "rhoThermo.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -54,18 +54,9 @@ namespace Foam
class solidThermo
:
public basicThermo
public rhoThermo
{
protected:
// Fields
//- Density [kg/m3]
volScalarField rho_;
public:
//- Runtime type information
@ -116,50 +107,9 @@ public:
// Member functions
//- Update properties
virtual void correct() = 0;
// Access to thermodynamic state variables
//- Constant access to temperature [K]
virtual const volScalarField& T() const;
//- Non constant access to temperature [K]
virtual volScalarField& T();
//- Solid density [kg/m3]
virtual const volScalarField& rhos() const;
//- Non-const access for solid density [kg/m3]
virtual volScalarField& rhos();
//- Constant access to p [Pa]
virtual const volScalarField& p() const;
//- Non-constant access to p [Pa]
virtual volScalarField& p();
// Access to transport state variables
//- Thermal diffusivity for enthalpy of mixture [kg/m/s]
virtual const volScalarField& alpha() const;
// Derived thermal properties
//- Enthalpy/Internal energy [J/kg]
virtual const volScalarField& he() const = 0;
//- Enthalpy/Internal energy [J/kg]
// Non-const access allowed for transport equations
virtual volScalarField& he() = 0;
//- Thermal conductivity [W/m/K]
virtual tmp<volScalarField> kappa() const = 0;
//- Thermal conductivity [W/m/K]
virtual tmp<volVectorField> Kappa() const = 0;
@ -172,50 +122,12 @@ public:
//- Emissivity coefficient [1/m]
virtual tmp<volScalarField> emissivity() const = 0;
//- Specific heat capacity [J/kg/K]
virtual tmp<volScalarField> Cp() const = 0;
//- Heat of formation [J/kg]
virtual tmp<volScalarField> hc() const = 0;
//- Density [kg/m^3]
virtual tmp<volScalarField> rho() const;
// Per patch calculation
//- Enthalpy/Internal energy [J/kg]
virtual tmp<scalarField> he
(
const scalarField& p,
const scalarField& T,
const label patchi
) const = 0;
//- Specific heat capacity [J/kg/K)]
virtual tmp<scalarField> Cp
(
const scalarField& p,
const scalarField& T,
const label patchI
) const = 0;
//- Isotropic thermal conductivity [W//m/K]
virtual tmp<scalarField> kappa
(
const label patchI
) const = 0;
//- Anisotropic thermal conductivity [W/m/K]
virtual tmp<vectorField> Kappa
(
const label patchI
) const = 0;
//- Thermal diffusivity for enthalpy of mixture [kg/m/s]
virtual tmp<scalarField> alpha
(
const label patchI
) const = 0;

View File

@ -1,40 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class polyBoundaryMesh;
location "constant/polyMesh";
object boundary;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
3
(
movingWall
{
type wall;
nFaces 20;
startFace 760;
}
fixedWalls
{
type wall;
nFaces 60;
startFace 780;
}
frontAndBack
{
type empty;
nFaces 800;
startFace 840;
}
)
// ************************************************************************* //

View File

@ -12,5 +12,6 @@ application=`getApplication`
#runApplication $application
runApplication decomposePar
runParallel $application 4
runApplication reconstructPar
# ----------------------------------------------------------------- end-of-file

View File

@ -17,7 +17,7 @@ FoamFile
libs ("libOpenFOAM.so" "libfieldFunctionObjects.so");
application simpleFoam;
application pisoFoam;
startFrom latestTime;

View File

@ -292,7 +292,7 @@ meshQualityControls
// <0 = inside out tet,
// 0 = flat tet
// 1 = regular tet
minTetQuality 1e-30;
minTetQuality 1e-9;
//- Minimum face area. Set to <0 to disable.
minArea -1;

View File

@ -13,4 +13,4 @@ ctoo = $(WM_SCHEDULER) $(cc) $(cFLAGS) -c $$SOURCE -o $@
LINK_LIBS = $(cDBUG) -L$(IA32ROOT)/lib
LINKLIBSO = $(cc) $(cFLAGS) -shared
LINKEXE = $(cc) $(cFLAGS)
LINKEXE = $(cc) $(cFLAGS) -Xlinker --add-needed -Xlinker -z -Xlinker nodefs

View File

@ -17,5 +17,5 @@ cpptoo = $(Ctoo)
LINK_LIBS = $(c++DBUG) -L$(IA64ROOT)/lib
LINKLIBSO = $(CC) $(c++FLAGS) -shared
LINKEXE = $(CC) $(c++FLAGS)
LINKLIBSO = $(CC) $(c++FLAGS) -shared -Xlinker --add-needed -Xlinker --no-as-needed
LINKEXE = $(CC) $(c++FLAGS) -Xlinker --add-needed -Xlinker --no-as-needed

View File

@ -13,4 +13,4 @@ ctoo = $(WM_SCHEDULER) $(cc) $(cFLAGS) -c $$SOURCE -o $@
LINK_LIBS = $(cDBUG) -L$(IA32ROOT)/lib
LINKLIBSO = $(cc) $(cFLAGS) -shared
LINKEXE = $(cc) $(cFLAGS)
LINKEXE = $(cc) $(cFLAGS) -Xlinker --add-needed -Xlinker -z -Xlinker nodefs

View File

@ -19,5 +19,5 @@ cpptoo = $(Ctoo)
#LINK_LIBS = $(c++DBUG) -lstdc++
LINK_LIBS = $(c++DBUG) -L$(IA32ROOT)/lib
LINKLIBSO = $(CC) $(c++FLAGS) -shared
LINKEXE = $(CC) $(c++FLAGS)
LINKLIBSO = $(CC) $(c++FLAGS) -shared -Xlinker --add-needed -Xlinker --no-as-needed
LINKEXE = $(CC) $(c++FLAGS) -Xlinker --add-needed -Xlinker --no-as-needed