Commit 3efed9f3 authored by andy's avatar andy
Browse files

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

parents 74df36e9 ffffda19
......@@ -39,8 +39,6 @@ Description
+ massSource.SuTot()
);
rhoEqn.relax();
rhoEqn.solve();
}
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2010-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -453,6 +453,7 @@ void Foam::createShellMesh::setRefinement
label region0 = pointRegions_[eFaces[0]][fp0];
label region1 = pointRegions_[eFaces[0]][fp1];
// Pick up points with correct normal
if (layerI == 0)
{
newF[0] = f[fp0];
......@@ -468,6 +469,22 @@ void Foam::createShellMesh::setRefinement
newF[3] = addedPoints[nLayers*region0+layerI];
}
// Optionally rotate so e[0] is always 0th vertex. Note that
// this normally is automatically done by coupled face ordering
// but with NOORDERING we have to do it ourselves.
if (f[fp0] != e[0])
{
// rotate one back to get newF[1] (originating from e[0])
// into newF[0]
label v0 = newF[0];
for (label i = 0; i < newF.size()-1; i++)
{
newF[i] = newF[newF.fcIndex(i)];
}
newF.last() = v0;
}
label minCellI = addedCells[nLayers*eFaces[0]+layerI];
label maxCellI;
label patchI;
......@@ -569,6 +586,21 @@ void Foam::createShellMesh::setRefinement
newF[3] = addedPoints[nLayers*region0+layerI];
}
// Optionally rotate so e[0] is always 0th vertex. Note that
// this normally is automatically done by coupled face
// ordering but with NOORDERING we have to do it ourselves.
if (f[fp0] != e[0])
{
// rotate one back to get newF[1] (originating
// from e[0]) into newF[0].
label v0 = newF[0];
for (label i = 0; i < newF.size()-1; i++)
{
newF[i] = newF[newF.fcIndex(i)];
}
newF.last() = v0;
}
////if (ePatches.size() == 0)
//{
// Pout<< "Adding from MULTI face:"
......
......@@ -492,6 +492,7 @@ DebugSwitches
geomCellLooper 0;
geometricSurfacePatch 0;
global 0;
globalIndexAndTransform 0;
globalMeshData 0;
globalPoints 0;
gnuplot 0;
......
......@@ -2282,7 +2282,7 @@ void Foam::indexedOctree<Type>::writeOBJ
{
subBb = nodes_[getNode(index)].bb_;
}
else if (isContent(index))
else if (isContent(index) || isEmpty(index))
{
subBb = nodes_[nodeI].bb_.subBbox(octant);
}
......@@ -2290,17 +2290,21 @@ void Foam::indexedOctree<Type>::writeOBJ
Pout<< "dumpContentNode : writing node:" << nodeI << " octant:" << octant
<< " to " << str.name() << endl;
label vertI = 0;
// Dump bounding box
pointField bbPoints(subBb.points());
label pointVertI = vertI;
forAll(bbPoints, i)
{
const point& pt = bbPoints[i];
str<< "v " << pt.x() << ' ' << pt.y() << ' ' << pt.z() << endl;
}
forAll(treeBoundBox::edges, i)
{
const edge& e = treeBoundBox::edges[i];
str<< "l " << e[0]+pointVertI+1 << ' ' << e[1]+pointVertI+1 << nl;
str<< "l " << e[0] + 1 << ' ' << e[1] + 1 << nl;
}
}
......@@ -2852,6 +2856,11 @@ void Foam::indexedOctree<Type>::print
{
const labelList& indices = contents_[getContent(index)];
if (debug)
{
writeOBJ(nodeI, octant);
}
os << "octant:" << octant
<< " content: n:" << indices.size()
<< " bb:" << subBb;
......@@ -2868,6 +2877,11 @@ void Foam::indexedOctree<Type>::print
}
else
{
if (debug)
{
writeOBJ(nodeI, octant);
}
os << "octant:" << octant << " empty:" << subBb << endl;
}
}
......
......@@ -499,7 +499,7 @@ Foam::point Foam::face::centre(const pointField& points) const
const label nPoints = size();
// If the face is a triangle, do a direct calculation
if (nPoints)
if (nPoints == 3)
{
return
(1.0/3.0)
......
......@@ -24,11 +24,12 @@ License
\*---------------------------------------------------------------------------*/
#include "globalIndexAndTransform.H"
#include "coupledPolyPatch.H"
#include "cyclicPolyPatch.H"
// * * * * * * * * * * * * Private Static Data Members * * * * * * * * * * * //
defineTypeNameAndDebug(Foam::globalIndexAndTransform, 0);
const Foam::label Foam::globalIndexAndTransform::base_ = 32;
......@@ -478,6 +479,41 @@ Foam::globalIndexAndTransform::globalIndexAndTransform
determineTransformPermutations();
determinePatchTransformSign();
if (debug && transforms_.size() > 1)
{
Info<< "Determined global transforms :" << endl;
Info<< "\t\ttranslation\trotation" << endl;
forAll(transforms_, i)
{
Info<< '\t' << i << '\t';
if (transforms_[i].hasR())
{
Info<< transforms_[i].t() << '\t' << transforms_[i].R();
}
else
{
Info<< transforms_[i].t() << '\t' << "---";
}
Info<< endl;
}
Info<< endl;
const polyBoundaryMesh& patches = mesh_.boundaryMesh();
Info<< "\tpatch\ttransform\tsign" << endl;
forAll(patchTransformSign_, patchI)
{
if (patchTransformSign_[patchI].first() != -1)
{
Info<< '\t' << patches[patchI].name()
<< '\t' << patchTransformSign_[patchI].first()
<< '\t' << patchTransformSign_[patchI].second()
<< endl;
}
}
Info<< endl;
}
}
......
......@@ -164,6 +164,10 @@ public:
friend class globalPoints;
// Declare name of the class and its debug switch
ClassName("globalIndexAndTransform");
// Constructors
//- Construct from components
......
......@@ -344,6 +344,11 @@ public:
// Access
const polyMesh& mesh() const
{
return mesh_;
}
const labelIOList& cellLevel() const
{
return cellLevel_;
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -690,9 +690,9 @@ void Foam::refinementHistory::distribute(const mapDistributePolyMesh& map)
// Remove unreferenced history.
compact();
Pout<< nl << "--BEFORE:" << endl;
writeDebug();
Pout<< "---------" << nl << endl;
//Pout<< nl << "--BEFORE:" << endl;
//writeDebug();
//Pout<< "---------" << nl << endl;
// Distribution is only partially functional.
......@@ -746,18 +746,18 @@ void Foam::refinementHistory::distribute(const mapDistributePolyMesh& map)
}
}
Pout<< "refinementHistory::distribute :"
<< " splitCellProc:" << splitCellProc << endl;
Pout<< "refinementHistory::distribute :"
<< " splitCellNum:" << splitCellNum << endl;
//Pout<< "refinementHistory::distribute :"
// << " splitCellProc:" << splitCellProc << endl;
//
//Pout<< "refinementHistory::distribute :"
// << " splitCellNum:" << splitCellNum << endl;
// Create subsetted refinement tree consisting of all parents that
// move in their whole to other processor.
for (label procI = 0; procI < Pstream::nProcs(); procI++)
{
Pout<< "-- Subetting for processor " << procI << endl;
//Pout<< "-- Subetting for processor " << procI << endl;
// From uncompacted to compacted splitCells.
labelList oldToNew(splitCells_.size(), -1);
......@@ -781,10 +781,10 @@ Pout<< "refinementHistory::distribute :"
oldToNew[index] = newSplitCells.size();
newSplitCells.append(splitCells_[index]);
Pout<< "Added oldCell " << index
<< " info " << newSplitCells.last()
<< " at position " << newSplitCells.size()-1
<< endl;
//Pout<< "Added oldCell " << index
// << " info " << newSplitCells.last()
// << " at position " << newSplitCells.size()-1
// << endl;
}
}
......@@ -797,9 +797,9 @@ Pout<< "refinementHistory::distribute :"
{
label parent = splitCells_[index].parent_;
Pout<< "Adding refined cell " << cellI
<< " since moves to "
<< procI << " old parent:" << parent << endl;
//Pout<< "Adding refined cell " << cellI
// << " since moves to "
// << procI << " old parent:" << parent << endl;
// Create new splitCell with parent
oldToNew[index] = newSplitCells.size();
......@@ -891,8 +891,8 @@ Pout<< "refinementHistory::distribute :"
// renumbering can be done here.
label offset = splitCells_.size();
Pout<< "**Renumbering data from proc " << procI << " with offset "
<< offset << endl;
//Pout<< "**Renumbering data from proc " << procI << " with offset "
// << offset << endl;
forAll(newSplitCells, index)
{
......@@ -929,9 +929,9 @@ Pout<< "refinementHistory::distribute :"
}
splitCells_.shrink();
Pout<< nl << "--AFTER:" << endl;
writeDebug();
Pout<< "---------" << nl << endl;
//Pout<< nl << "--AFTER:" << endl;
//writeDebug();
//Pout<< "---------" << nl << endl;
}
......
......@@ -204,8 +204,8 @@ $(interpolation)/interpolationCellPoint/makeInterpolationCellPoint.C
$(interpolation)/interpolationCellPointFace/makeInterpolationCellPointFace.C
$(interpolation)/interpolationCellPointWallModified/cellPointWeightWallModified/cellPointWeightWallModified.C
$(interpolation)/interpolationCellPointWallModified/makeInterpolationCellPointWallModified.C
$(interpolation)/interpolationPoint/pointMVCWeight.C
$(interpolation)/interpolationPoint/makeInterpolationPoint.C
$(interpolation)/interpolationPointMVC/pointMVCWeight.C
$(interpolation)/interpolationPointMVC/makeInterpolationPointMVC.C
volPointInterpolation = interpolation/volPointInterpolation
$(volPointInterpolation)/volPointInterpolation.C
......
......@@ -42,16 +42,6 @@ SourceFiles
fvMesh.C
fvMeshGeometry.C
See Also
hmm
Usage
oeuoeuoeu
ToDo
oeuoeuoeu
oeueouoeu
\*---------------------------------------------------------------------------*/
#ifndef fvMesh_H
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2010-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -23,13 +23,13 @@ License
\*---------------------------------------------------------------------------*/
#include "interpolationPoint.H"
#include "interpolationPointMVC.H"
#include "volPointInterpolation.H"
// * * * * * * * * * * * * * * * * Constructor * * * * * * * * * * * * * * * //
template<class Type>
Foam::interpolationPoint<Type>::interpolationPoint
Foam::interpolationPointMVC<Type>::interpolationPointMVC
(
const GeometricField<Type, fvPatchField, volMesh>& psi
)
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2010-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -22,7 +22,7 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::interpolationPoint
Foam::interpolationPointMVC
Description
Given cell centre values interpolates to vertices and uses these to
......@@ -30,8 +30,8 @@ Description
\*---------------------------------------------------------------------------*/
#ifndef interpolationPoint_H
#define interpolationPoint_H
#ifndef interpolationPointMVC_H
#define interpolationPointMVC_H
#include "interpolation.H"
#include "pointMVCWeight.H"
......@@ -42,11 +42,11 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class interpolationPoint Declaration
Class interpolationPointMVC Declaration
\*---------------------------------------------------------------------------*/
template<class Type>
class interpolationPoint
class interpolationPointMVC
:
public interpolation<Type>
{
......@@ -57,16 +57,17 @@ protected:
//- Interpolated volfield
const GeometricField<Type, pointPatchField, pointMesh> psip_;
public:
//- Runtime type information
TypeName("point");
TypeName("pointMVC");
// Constructors
//- Construct from components
interpolationPoint
interpolationPointMVC
(
const GeometricField<Type, fvPatchField, volMesh>& psi
);
......@@ -93,12 +94,12 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "interpolationPointI.H"
#include "interpolationPointMVCI.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "interpolationPoint.C"
# include "interpolationPointMVC.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2010-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -26,7 +26,7 @@ License
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type>
inline Type Foam::interpolationPoint<Type>::interpolate
inline Type Foam::interpolationPointMVC<Type>::interpolate
(
const pointMVCWeight& cpw
) const
......@@ -36,7 +36,7 @@ inline Type Foam::interpolationPoint<Type>::interpolate
template<class Type>
inline Type Foam::interpolationPoint<Type>::interpolate
inline Type Foam::interpolationPointMVC<Type>::interpolate
(
const vector& position,
const label cellI,
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2010-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -23,13 +23,13 @@ License
\*---------------------------------------------------------------------------*/
#include "interpolationPoint.H"
#include "interpolationPointMVC.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
makeInterpolation(interpolationPoint);
makeInterpolation(interpolationPointMVC);
}
// ************************************************************************* //
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2010-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -56,7 +56,7 @@ void Foam::pointMVCWeight::calcWeights
forAll(f, j)
{
label jPlus1 = f.fcIndex(j);
scalar l = mag(u[j]-u[jPlus1]);
scalar l = mag(u[j] - u[jPlus1]);
theta[j] = 2.0*Foam::asin(l/2.0);
}
......@@ -68,7 +68,7 @@ void Foam::pointMVCWeight::calcWeights
weights[pid] =
1.0
/ dist[pid]
* (Foam::tan(theta[jMin1]/2.0)+Foam::tan(theta[j]/2.0));
* (Foam::tan(theta[jMin1]/2.0) + Foam::tan(theta[j]/2.0));
sumWeight += weights[pid];
}
......@@ -132,11 +132,10 @@ void Foam::pointMVCWeight::calcWeights
//Pout<< " uj:" << u[j] << " ujPlus1:" << u[jPlus1]
// << " temp:" << temp << endl;
scalar l = mag(u[j]-u[jPlus1]);
scalar l = min(mag(u[j] - u[jPlus1]), 2.0);
scalar angle = 2.0*Foam::asin(l/2.0);
//Pout<< " j:" << j << " l:" << l
// << " angle:" << angle << endl;
//Pout<< " j:" << j << " l:" << l << " angle:" << angle << endl;
v += 0.5*angle*temp;
}
......@@ -145,14 +144,14 @@ void Foam::pointMVCWeight::calcWeights
v /= vNorm;
// Make sure v points towards the polygon
//if (((v&u[0]) < 0) != (mesh.faceOwner()[faceI] != cellIndex_))
//{
// FatalErrorIn("pointMVCWeight::calcWeights(..)")
// << "v:" << v << " u[0]:" << u[0]
// << exit(FatalError);
//}
if ((v&u[0]) < 0)
//if (((v&u[0]) < 0) != (mesh.faceOwner()[faceI] != cellIndex_))
//{
// FatalErrorIn("pointMVCWeight::calcWeights(..)")
// << "v:" << v << " u[0]:" << u[0]
// << exit(FatalError);
//}
if ((v & u[0]) < 0)
{
v = -v;
}
......@@ -165,22 +164,22 @@ void Foam::pointMVCWeight::calcWeights
label jPlus1 = f.fcIndex(j);
//Pout<< " uj:" << u[j] << " ujPlus1:" << u[jPlus1] << endl;
vector n0 = u[j] ^ v;
vector n0 = u[j]^v;
n0 /= mag(n0);
vector n1 = u[jPlus1] ^ v;
vector n1 = u[jPlus1]^v;
n1 /= mag(n1);
scalar l = mag(n0-n1);
scalar l = min(mag(n0 - n1), 2.0);
//Pout<< " l:" << l << endl;
alpha(j) = 2.0*Foam::asin(l/2.0);
vector temp = n0 ^ n1;
vector temp = n0^n1;
if ((temp&v) < 0.0)
{
alpha[j] = -alpha[j];
}
l = mag(u[j]-v);
</