Merge branch 'master' into feature/cvMesh

Conflicts:
	applications/test/Matrix/Test-Matrix.C
	applications/utilities/mesh/generation/extrude2DMesh/extrude2DMesh/extrude2DMesh/extrude2DMesh.C
	applications/utilities/mesh/generation/extrude2DMesh/extrude2DMesh/extrude2DMesh/extrude2DMesh.H
	src/OpenFOAM/algorithms/indexedOctree/indexedOctree.C
	src/OpenFOAM/primitives/Tensor2D/Tensor2DI.H
This commit is contained in:
laurence
2013-04-05 16:09:24 +01:00
1087 changed files with 16553 additions and 13759 deletions

View File

@ -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
@ -21,7 +21,7 @@ License
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*----------------------------------------------------------------------------*/
\*---------------------------------------------------------------------------*/
#include "fileMonitor.H"
#include "IOstreams.H"

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-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -263,8 +263,8 @@ void Foam::sigFpe::set(const bool verbose)
{
if (supported)
{
Info<< "SetNaN : Initialising allocated memory to NaN"
<< " (FOAM_SETNAN)." << endl;
Info<< "SetNaN : Initialising allocated memory to NaN"
<< " (FOAM_SETNAN)." << endl;
}
else
{

View File

@ -368,6 +368,8 @@ $(cellShape)/cellShapeIOList.C
meshes/Identifiers/patch/patchIdentifier.C
meshes/MeshObject/meshObject.C
polyMesh = meshes/polyMesh
polyPatches = $(polyMesh)/polyPatches

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-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -30,7 +30,7 @@ License
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
template <class Type>
template<class Type>
Foam::scalar Foam::dynamicIndexedOctree<Type>::perturbTol_ = 10*SMALL;
@ -38,7 +38,7 @@ Foam::scalar Foam::dynamicIndexedOctree<Type>::perturbTol_ = 10*SMALL;
// Does bb intersect a sphere around sample? Or is any corner point of bb
// closer than nearestDistSqr to sample.
template <class Type>
template<class Type>
bool Foam::dynamicIndexedOctree<Type>::overlaps
(
const point& p0,
@ -82,7 +82,7 @@ bool Foam::dynamicIndexedOctree<Type>::overlaps
// Does bb intersect a sphere around sample? Or is any corner point of bb
// closer than nearestDistSqr to sample.
template <class Type>
template<class Type>
bool Foam::dynamicIndexedOctree<Type>::overlaps
(
const treeBoundBox& parentBb,
@ -145,7 +145,7 @@ bool Foam::dynamicIndexedOctree<Type>::overlaps
//
// Split list of indices into 8 bins
template <class Type>
template<class Type>
void Foam::dynamicIndexedOctree<Type>::divide
(
const autoPtr<DynamicList<label> >& indices,
@ -187,7 +187,7 @@ void Foam::dynamicIndexedOctree<Type>::divide
// Subdivide the (content) node.
template <class Type>
template<class Type>
typename Foam::dynamicIndexedOctree<Type>::node
Foam::dynamicIndexedOctree<Type>::divide
(
@ -280,7 +280,7 @@ Foam::dynamicIndexedOctree<Type>::divide
}
template <class Type>
template<class Type>
void Foam::dynamicIndexedOctree<Type>::recursiveSubDivision
(
const treeBoundBox& subBb,
@ -333,7 +333,7 @@ void Foam::dynamicIndexedOctree<Type>::recursiveSubDivision
// Pre-calculates wherever possible the volume status per node/subnode.
// Recurses to determine status of lowest level boxes. Level above is
// combination of octants below.
template <class Type>
template<class Type>
typename Foam::dynamicIndexedOctree<Type>::volumeType
Foam::dynamicIndexedOctree<Type>::calcVolumeType
(
@ -391,7 +391,7 @@ Foam::dynamicIndexedOctree<Type>::calcVolumeType
}
template <class Type>
template<class Type>
typename Foam::dynamicIndexedOctree<Type>::volumeType
Foam::dynamicIndexedOctree<Type>::getVolumeType
(
@ -467,7 +467,7 @@ Foam::dynamicIndexedOctree<Type>::getVolumeType
}
template <class Type>
template<class Type>
typename Foam::dynamicIndexedOctree<Type>::volumeType
Foam::dynamicIndexedOctree<Type>::getSide
(
@ -492,7 +492,7 @@ Foam::dynamicIndexedOctree<Type>::getSide
//
// Find nearest point starting from nodeI
template <class Type>
template<class Type>
void Foam::dynamicIndexedOctree<Type>::findNearest
(
const label nodeI,
@ -564,7 +564,7 @@ void Foam::dynamicIndexedOctree<Type>::findNearest
// Find nearest point to line.
template <class Type>
template<class Type>
void Foam::dynamicIndexedOctree<Type>::findNearest
(
const label nodeI,
@ -630,7 +630,7 @@ void Foam::dynamicIndexedOctree<Type>::findNearest
}
template <class Type>
template<class Type>
Foam::treeBoundBox Foam::dynamicIndexedOctree<Type>::subBbox
(
const label parentNodeI,
@ -656,7 +656,7 @@ Foam::treeBoundBox Foam::dynamicIndexedOctree<Type>::subBbox
// Takes a bb and a point on/close to the edge of the bb and pushes the point
// inside by a small fraction.
template <class Type>
template<class Type>
Foam::point Foam::dynamicIndexedOctree<Type>::pushPoint
(
const treeBoundBox& bb,
@ -727,7 +727,7 @@ Foam::point Foam::dynamicIndexedOctree<Type>::pushPoint
// Takes a bb and a point on the edge of the bb and pushes the point
// outside by a small fraction.
template <class Type>
template<class Type>
Foam::point Foam::dynamicIndexedOctree<Type>::pushPoint
(
const treeBoundBox& bb,
@ -840,7 +840,7 @@ Foam::point Foam::dynamicIndexedOctree<Type>::pushPoint
// Guarantees that if pt is on a face it gets perturbed so it is away
// from the face edges.
// If pt is not on a face does nothing.
template <class Type>
template<class Type>
Foam::point Foam::dynamicIndexedOctree<Type>::pushPointIntoFace
(
const treeBoundBox& bb,
@ -1000,7 +1000,7 @@ Foam::point Foam::dynamicIndexedOctree<Type>::pushPointIntoFace
//// Takes a bb and a point on the outside of the bb. Checks if on multiple
// faces
//// and if so perturbs point so it is only on one face.
//template <class Type>
//template<class Type>
//void Foam::dynamicIndexedOctree<Type>::checkMultipleFaces
//(
// const treeBoundBox& bb,
@ -1196,7 +1196,7 @@ Foam::point Foam::dynamicIndexedOctree<Type>::pushPointIntoFace
// Get parent node and octant. Return false if top of tree reached.
template <class Type>
template<class Type>
bool Foam::dynamicIndexedOctree<Type>::walkToParent
(
const label nodeI,
@ -1246,7 +1246,7 @@ bool Foam::dynamicIndexedOctree<Type>::walkToParent
// node and octant in this node and walks in the direction given by
// the facePointBits (combination of treeBoundBox::LEFTBIT, TOPBIT etc.)
// Returns false if edge of tree hit.
template <class Type>
template<class Type>
bool Foam::dynamicIndexedOctree<Type>::walkToNeighbour
(
const point& facePoint,
@ -1484,7 +1484,7 @@ bool Foam::dynamicIndexedOctree<Type>::walkToNeighbour
}
template <class Type>
template<class Type>
Foam::word Foam::dynamicIndexedOctree<Type>::faceString
(
const direction faceID
@ -1536,7 +1536,7 @@ Foam::word Foam::dynamicIndexedOctree<Type>::faceString
// Else return a miss and the bounding box face hit:
// hitInfo.point = coordinate of intersection of ray with bounding box
// hitBits = posbits of point on bounding box
template <class Type>
template<class Type>
void Foam::dynamicIndexedOctree<Type>::traverseNode
(
const bool findAny,
@ -1699,7 +1699,7 @@ void Foam::dynamicIndexedOctree<Type>::traverseNode
// Find first intersection
template <class Type>
template<class Type>
Foam::pointIndexHit Foam::dynamicIndexedOctree<Type>::findLine
(
const bool findAny,
@ -1887,7 +1887,7 @@ Foam::pointIndexHit Foam::dynamicIndexedOctree<Type>::findLine
// Find first intersection
template <class Type>
template<class Type>
Foam::pointIndexHit Foam::dynamicIndexedOctree<Type>::findLine
(
const bool findAny,
@ -1958,7 +1958,7 @@ Foam::pointIndexHit Foam::dynamicIndexedOctree<Type>::findLine
}
template <class Type>
template<class Type>
void Foam::dynamicIndexedOctree<Type>::findBox
(
const label nodeI,
@ -2005,7 +2005,7 @@ void Foam::dynamicIndexedOctree<Type>::findBox
}
template <class Type>
template<class Type>
void Foam::dynamicIndexedOctree<Type>::findSphere
(
const label nodeI,
@ -2053,8 +2053,8 @@ void Foam::dynamicIndexedOctree<Type>::findSphere
}
template <class Type>
template <class CompareOp>
template<class Type>
template<class CompareOp>
void Foam::dynamicIndexedOctree<Type>::findNear
(
const scalar nearDist,
@ -2228,7 +2228,7 @@ void Foam::dynamicIndexedOctree<Type>::findNear
// Number of elements in node.
template <class Type>
template<class Type>
Foam::label Foam::dynamicIndexedOctree<Type>::countElements
(
const labelBits index
@ -2261,7 +2261,7 @@ Foam::label Foam::dynamicIndexedOctree<Type>::countElements
}
template <class Type>
template<class Type>
void Foam::dynamicIndexedOctree<Type>::writeOBJ
(
const label nodeI,
@ -2310,7 +2310,7 @@ void Foam::dynamicIndexedOctree<Type>::writeOBJ
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template <class Type>
template<class Type>
Foam::dynamicIndexedOctree<Type>::dynamicIndexedOctree
(
const Type& shapes,
@ -2347,14 +2347,14 @@ Foam::dynamicIndexedOctree<Type>::dynamicIndexedOctree
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template <class Type>
template<class Type>
Foam::scalar& Foam::dynamicIndexedOctree<Type>::perturbTol()
{
return perturbTol_;
}
template <class Type>
template<class Type>
Foam::pointIndexHit Foam::dynamicIndexedOctree<Type>::findNearest
(
const point& sample,
@ -2382,7 +2382,7 @@ Foam::pointIndexHit Foam::dynamicIndexedOctree<Type>::findNearest
}
template <class Type>
template<class Type>
Foam::pointIndexHit Foam::dynamicIndexedOctree<Type>::findNearest
(
const linePointRef& ln,
@ -2416,7 +2416,7 @@ Foam::pointIndexHit Foam::dynamicIndexedOctree<Type>::findNearest
// Find nearest intersection
template <class Type>
template<class Type>
Foam::pointIndexHit Foam::dynamicIndexedOctree<Type>::findLine
(
const point& start,
@ -2428,7 +2428,7 @@ Foam::pointIndexHit Foam::dynamicIndexedOctree<Type>::findLine
// Find nearest intersection
template <class Type>
template<class Type>
Foam::pointIndexHit Foam::dynamicIndexedOctree<Type>::findLineAny
(
const point& start,
@ -2439,7 +2439,7 @@ Foam::pointIndexHit Foam::dynamicIndexedOctree<Type>::findLineAny
}
template <class Type>
template<class Type>
Foam::labelList Foam::dynamicIndexedOctree<Type>::findBox
(
const treeBoundBox& searchBox
@ -2457,7 +2457,7 @@ Foam::labelList Foam::dynamicIndexedOctree<Type>::findBox
}
template <class Type>
template<class Type>
Foam::labelList Foam::dynamicIndexedOctree<Type>::findSphere
(
const point& centre,
@ -2477,7 +2477,7 @@ Foam::labelList Foam::dynamicIndexedOctree<Type>::findSphere
// Find node (as parent+octant) containing point
template <class Type>
template<class Type>
Foam::labelBits Foam::dynamicIndexedOctree<Type>::findNode
(
const label nodeI,
@ -2524,7 +2524,7 @@ Foam::labelBits Foam::dynamicIndexedOctree<Type>::findNode
}
template <class Type>
template<class Type>
Foam::label Foam::dynamicIndexedOctree<Type>::findInside
(
const point& sample
@ -2556,7 +2556,7 @@ Foam::label Foam::dynamicIndexedOctree<Type>::findInside
}
template <class Type>
template<class Type>
const Foam::labelList& Foam::dynamicIndexedOctree<Type>::findIndices
(
const point& sample
@ -2581,7 +2581,7 @@ const Foam::labelList& Foam::dynamicIndexedOctree<Type>::findIndices
// Determine type (inside/outside/mixed) per node.
template <class Type>
template<class Type>
typename Foam::dynamicIndexedOctree<Type>::volumeType
Foam::dynamicIndexedOctree<Type>::getVolumeType
(
@ -2651,8 +2651,8 @@ Foam::dynamicIndexedOctree<Type>::getVolumeType
}
template <class Type>
template <class CompareOp>
template<class Type>
template<class CompareOp>
void Foam::dynamicIndexedOctree<Type>::findNear
(
const scalar nearDist,
@ -2675,7 +2675,7 @@ void Foam::dynamicIndexedOctree<Type>::findNear
}
template <class Type>
template<class Type>
bool Foam::dynamicIndexedOctree<Type>::insert(label startIndex, label endIndex)
{
if (startIndex == endIndex)
@ -2721,7 +2721,7 @@ bool Foam::dynamicIndexedOctree<Type>::insert(label startIndex, label endIndex)
}
template <class Type>
template<class Type>
bool Foam::dynamicIndexedOctree<Type>::insertIndex
(
const label nodIndex,
@ -2798,7 +2798,7 @@ bool Foam::dynamicIndexedOctree<Type>::insertIndex
}
template <class Type>
template<class Type>
bool Foam::dynamicIndexedOctree<Type>::remove(const label index)
{
if (nodes_.empty())
@ -2812,7 +2812,7 @@ bool Foam::dynamicIndexedOctree<Type>::remove(const label index)
}
template <class Type>
template<class Type>
Foam::label Foam::dynamicIndexedOctree<Type>::removeIndex
(
const label nodIndex,
@ -2896,7 +2896,7 @@ Foam::label Foam::dynamicIndexedOctree<Type>::removeIndex
// Print contents of nodeI
template <class Type>
template<class Type>
void Foam::dynamicIndexedOctree<Type>::print
(
prefixOSstream& os,
@ -2969,7 +2969,7 @@ void Foam::dynamicIndexedOctree<Type>::print
}
template <class Type>
template<class Type>
void Foam::dynamicIndexedOctree<Type>::writeTreeInfo() const
{
label nEntries = 0;
@ -2996,7 +2996,7 @@ void Foam::dynamicIndexedOctree<Type>::writeTreeInfo() const
// Print contents of nodeI
template <class Type>
template<class Type>
bool Foam::dynamicIndexedOctree<Type>::write(Ostream& os) const
{
os << *this;
@ -3005,7 +3005,7 @@ bool Foam::dynamicIndexedOctree<Type>::write(Ostream& os) const
}
template <class Type>
template<class Type>
Foam::Ostream&
Foam::operator<<(Ostream& os, const dynamicIndexedOctree<Type>& 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-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -74,7 +74,7 @@ TemplateName(dynamicIndexedOctree);
Class dynamicIndexedOctree Declaration
\*---------------------------------------------------------------------------*/
template <class Type>
template<class Type>
class dynamicIndexedOctree
:
public dynamicIndexedOctreeName
@ -372,7 +372,7 @@ private:
) const;
template <class CompareOp>
template<class CompareOp>
static void findNear
(
const scalar nearDist,
@ -632,7 +632,7 @@ public:
//- Find near pairs and apply CompareOp to them.
// tree2 can be *this or different tree.
template <class CompareOp>
template<class CompareOp>
void findNear
(
const scalar nearDist,

View File

@ -30,7 +30,7 @@ License
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
template <class Type>
template<class Type>
Foam::scalar Foam::indexedOctree<Type>::perturbTol_ = 10*SMALL;
@ -38,7 +38,7 @@ Foam::scalar Foam::indexedOctree<Type>::perturbTol_ = 10*SMALL;
// Does bb intersect a sphere around sample? Or is any corner point of bb
// closer than nearestDistSqr to sample.
template <class Type>
template<class Type>
bool Foam::indexedOctree<Type>::overlaps
(
const point& p0,
@ -55,7 +55,7 @@ bool Foam::indexedOctree<Type>::overlaps
// Does bb intersect a sphere around sample? Or is any corner point of bb
// closer than nearestDistSqr to sample.
template <class Type>
template<class Type>
bool Foam::indexedOctree<Type>::overlaps
(
const treeBoundBox& parentBb,
@ -118,7 +118,7 @@ bool Foam::indexedOctree<Type>::overlaps
//
// Split list of indices into 8 bins
template <class Type>
template<class Type>
void Foam::indexedOctree<Type>::divide
(
const labelList& indices,
@ -161,7 +161,7 @@ void Foam::indexedOctree<Type>::divide
// Subdivide the (content) node.
template <class Type>
template<class Type>
typename Foam::indexedOctree<Type>::node
Foam::indexedOctree<Type>::divide
(
@ -231,7 +231,7 @@ Foam::indexedOctree<Type>::divide
// Split any contents node with more than minSize elements.
template <class Type>
template<class Type>
void Foam::indexedOctree<Type>::splitNodes
(
const label minSize,
@ -285,7 +285,7 @@ void Foam::indexedOctree<Type>::splitNodes
// Reorder contents to be in same order as nodes. Returns number of nodes on
// the compactLevel.
template <class Type>
template<class Type>
Foam::label Foam::indexedOctree<Type>::compactContents
(
DynamicList<node>& nodes,
@ -355,7 +355,7 @@ Foam::label Foam::indexedOctree<Type>::compactContents
// Pre-calculates wherever possible the volume status per node/subnode.
// Recurses to determine status of lowest level boxes. Level above is
// combination of octants below.
template <class Type>
template<class Type>
typename Foam::indexedOctree<Type>::volumeType
Foam::indexedOctree<Type>::calcVolumeType
(
@ -413,7 +413,7 @@ Foam::indexedOctree<Type>::calcVolumeType
}
template <class Type>
template<class Type>
typename Foam::indexedOctree<Type>::volumeType
Foam::indexedOctree<Type>::getVolumeType
(
@ -489,7 +489,7 @@ Foam::indexedOctree<Type>::getVolumeType
}
template <class Type>
template<class Type>
typename Foam::indexedOctree<Type>::volumeType
Foam::indexedOctree<Type>::getSide
(
@ -514,7 +514,7 @@ Foam::indexedOctree<Type>::getSide
//
//template <class Type>
//template<class Type>
//bool Foam::indexedOctree<Type>::findAnyOverlap
//(
// const label nodeI,
@ -575,8 +575,8 @@ Foam::indexedOctree<Type>::getSide
// Find nearest point starting from nodeI
template <class Type>
template <class FindNearestOp>
template<class Type>
template<class FindNearestOp>
void Foam::indexedOctree<Type>::findNearest
(
const label nodeI,
@ -652,8 +652,8 @@ void Foam::indexedOctree<Type>::findNearest
// Find nearest point to line.
template <class Type>
template <class FindNearestOp>
template<class Type>
template<class FindNearestOp>
void Foam::indexedOctree<Type>::findNearest
(
const label nodeI,
@ -723,7 +723,7 @@ void Foam::indexedOctree<Type>::findNearest
}
template <class Type>
template<class Type>
Foam::treeBoundBox Foam::indexedOctree<Type>::subBbox
(
const label parentNodeI,
@ -749,7 +749,7 @@ Foam::treeBoundBox Foam::indexedOctree<Type>::subBbox
// Takes a bb and a point on/close to the edge of the bb and pushes the point
// inside by a small fraction.
template <class Type>
template<class Type>
Foam::point Foam::indexedOctree<Type>::pushPoint
(
const treeBoundBox& bb,
@ -820,7 +820,7 @@ Foam::point Foam::indexedOctree<Type>::pushPoint
// Takes a bb and a point on the edge of the bb and pushes the point
// outside by a small fraction.
template <class Type>
template<class Type>
Foam::point Foam::indexedOctree<Type>::pushPoint
(
const treeBoundBox& bb,
@ -933,7 +933,7 @@ Foam::point Foam::indexedOctree<Type>::pushPoint
// Guarantees that if pt is on a face it gets perturbed so it is away
// from the face edges.
// If pt is not on a face does nothing.
template <class Type>
template<class Type>
Foam::point Foam::indexedOctree<Type>::pushPointIntoFace
(
const treeBoundBox& bb,
@ -1093,7 +1093,7 @@ Foam::point Foam::indexedOctree<Type>::pushPointIntoFace
//// Takes a bb and a point on the outside of the bb. Checks if on multiple
// faces
//// and if so perturbs point so it is only on one face.
//template <class Type>
//template<class Type>
//void Foam::indexedOctree<Type>::checkMultipleFaces
//(
// const treeBoundBox& bb,
@ -1289,7 +1289,7 @@ Foam::point Foam::indexedOctree<Type>::pushPointIntoFace
// Get parent node and octant. Return false if top of tree reached.
template <class Type>
template<class Type>
bool Foam::indexedOctree<Type>::walkToParent
(
const label nodeI,
@ -1339,7 +1339,7 @@ bool Foam::indexedOctree<Type>::walkToParent
// node and octant in this node and walks in the direction given by
// the facePointBits (combination of treeBoundBox::LEFTBIT, TOPBIT etc.)
// Returns false if edge of tree hit.
template <class Type>
template<class Type>
bool Foam::indexedOctree<Type>::walkToNeighbour
(
const point& facePoint,
@ -1577,7 +1577,7 @@ bool Foam::indexedOctree<Type>::walkToNeighbour
}
template <class Type>
template<class Type>
Foam::word Foam::indexedOctree<Type>::faceString
(
const direction faceID
@ -1629,8 +1629,8 @@ Foam::word Foam::indexedOctree<Type>::faceString
// Else return a miss and the bounding box face hit:
// hitInfo.point = coordinate of intersection of ray with bounding box
// hitBits = posbits of point on bounding box
template <class Type>
template <class FindIntersectOp>
template<class Type>
template<class FindIntersectOp>
void Foam::indexedOctree<Type>::traverseNode
(
const bool findAny,
@ -1790,8 +1790,8 @@ void Foam::indexedOctree<Type>::traverseNode
// Find first intersection
template <class Type>
template <class FindIntersectOp>
template<class Type>
template<class FindIntersectOp>
Foam::pointIndexHit Foam::indexedOctree<Type>::findLine
(
const bool findAny,
@ -1987,7 +1987,7 @@ Foam::pointIndexHit Foam::indexedOctree<Type>::findLine
}
//template <class Type>
//template<class Type>
//bool Foam::indexedOctree<Type>::isLineInsideOrOutside
//(
// const label nodeI,
@ -2020,8 +2020,8 @@ Foam::pointIndexHit Foam::indexedOctree<Type>::findLine
// Find first intersection
template <class Type>
template <class FindIntersectOp>
template<class Type>
template<class FindIntersectOp>
Foam::pointIndexHit Foam::indexedOctree<Type>::findLine
(
const bool findAny,
@ -2094,7 +2094,7 @@ Foam::pointIndexHit Foam::indexedOctree<Type>::findLine
}
template <class Type>
template<class Type>
void Foam::indexedOctree<Type>::findBox
(
const label nodeI,
@ -2141,7 +2141,7 @@ void Foam::indexedOctree<Type>::findBox
}
template <class Type>
template<class Type>
void Foam::indexedOctree<Type>::findSphere
(
const label nodeI,
@ -2189,8 +2189,8 @@ void Foam::indexedOctree<Type>::findSphere
}
template <class Type>
template <class CompareOp>
template<class Type>
template<class CompareOp>
void Foam::indexedOctree<Type>::findNear
(
const scalar nearDist,
@ -2364,7 +2364,7 @@ void Foam::indexedOctree<Type>::findNear
// Number of elements in node.
template <class Type>
template<class Type>
Foam::label Foam::indexedOctree<Type>::countElements
(
const labelBits index
@ -2397,7 +2397,7 @@ Foam::label Foam::indexedOctree<Type>::countElements
}
template <class Type>
template<class Type>
void Foam::indexedOctree<Type>::writeOBJ
(
const label nodeI,
@ -2446,7 +2446,7 @@ void Foam::indexedOctree<Type>::writeOBJ
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template <class Type>
template<class Type>
Foam::indexedOctree<Type>::indexedOctree(const Type& shapes)
:
shapes_(shapes),
@ -2456,7 +2456,7 @@ Foam::indexedOctree<Type>::indexedOctree(const Type& shapes)
{}
template <class Type>
template<class Type>
Foam::indexedOctree<Type>::indexedOctree
(
const Type& shapes,
@ -2471,7 +2471,7 @@ Foam::indexedOctree<Type>::indexedOctree
{}
template <class Type>
template<class Type>
Foam::indexedOctree<Type>::indexedOctree
(
const Type& shapes,
@ -2623,7 +2623,7 @@ Foam::indexedOctree<Type>::indexedOctree
}
template <class Type>
template<class Type>
Foam::indexedOctree<Type>::indexedOctree
(
const Type& shapes,
@ -2639,14 +2639,14 @@ Foam::indexedOctree<Type>::indexedOctree
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template <class Type>
template<class Type>
Foam::scalar& Foam::indexedOctree<Type>::perturbTol()
{
return perturbTol_;
}
//template <class Type>
//template<class Type>
//bool Foam::indexedOctree<Type>::findAnyOverlap
//(
// const point& sample,
@ -2667,7 +2667,7 @@ Foam::scalar& Foam::indexedOctree<Type>::perturbTol()
//}
template <class Type>
template<class Type>
Foam::pointIndexHit Foam::indexedOctree<Type>::findNearest
(
const point& sample,
@ -2683,8 +2683,8 @@ Foam::pointIndexHit Foam::indexedOctree<Type>::findNearest
}
template <class Type>
template <class FindNearestOp>
template<class Type>
template<class FindNearestOp>
Foam::pointIndexHit Foam::indexedOctree<Type>::findNearest
(
const point& sample,
@ -2716,7 +2716,7 @@ Foam::pointIndexHit Foam::indexedOctree<Type>::findNearest
}
template <class Type>
template<class Type>
Foam::pointIndexHit Foam::indexedOctree<Type>::findNearest
(
const linePointRef& ln,
@ -2734,8 +2734,8 @@ Foam::pointIndexHit Foam::indexedOctree<Type>::findNearest
}
template <class Type>
template <class FindNearestOp>
template<class Type>
template<class FindNearestOp>
Foam::pointIndexHit Foam::indexedOctree<Type>::findNearest
(
const linePointRef& ln,
@ -2769,7 +2769,7 @@ Foam::pointIndexHit Foam::indexedOctree<Type>::findNearest
// Find nearest intersection
template <class Type>
template<class Type>
Foam::pointIndexHit Foam::indexedOctree<Type>::findLine
(
const point& start,
@ -2787,7 +2787,7 @@ Foam::pointIndexHit Foam::indexedOctree<Type>::findLine
// Find nearest intersection
template <class Type>
template<class Type>
Foam::pointIndexHit Foam::indexedOctree<Type>::findLineAny
(
const point& start,
@ -2805,8 +2805,8 @@ Foam::pointIndexHit Foam::indexedOctree<Type>::findLineAny
// Find nearest intersection
template <class Type>
template <class FindIntersectOp>
template<class Type>
template<class FindIntersectOp>
Foam::pointIndexHit Foam::indexedOctree<Type>::findLine
(
const point& start,
@ -2819,8 +2819,8 @@ Foam::pointIndexHit Foam::indexedOctree<Type>::findLine
// Find nearest intersection
template <class Type>
template <class FindIntersectOp>
template<class Type>
template<class FindIntersectOp>
Foam::pointIndexHit Foam::indexedOctree<Type>::findLineAny
(
const point& start,
@ -2832,7 +2832,7 @@ Foam::pointIndexHit Foam::indexedOctree<Type>::findLineAny
}
template <class Type>
template<class Type>
Foam::labelList Foam::indexedOctree<Type>::findBox
(
const treeBoundBox& searchBox
@ -2850,7 +2850,7 @@ Foam::labelList Foam::indexedOctree<Type>::findBox
}
template <class Type>
template<class Type>
Foam::labelList Foam::indexedOctree<Type>::findSphere
(
const point& centre,
@ -2870,7 +2870,7 @@ Foam::labelList Foam::indexedOctree<Type>::findSphere
// Find node (as parent+octant) containing point
template <class Type>
template<class Type>
Foam::labelBits Foam::indexedOctree<Type>::findNode
(
const label nodeI,
@ -2917,7 +2917,7 @@ Foam::labelBits Foam::indexedOctree<Type>::findNode
}
template <class Type>
template<class Type>
Foam::label Foam::indexedOctree<Type>::findInside(const point& sample) const
{
labelBits index = findNode(0, sample);
@ -2946,7 +2946,7 @@ Foam::label Foam::indexedOctree<Type>::findInside(const point& sample) const
}
template <class Type>
template<class Type>
const Foam::labelList& Foam::indexedOctree<Type>::findIndices
(
const point& sample
@ -2971,7 +2971,7 @@ const Foam::labelList& Foam::indexedOctree<Type>::findIndices
// Determine type (inside/outside/mixed) per node.
template <class Type>
template<class Type>
typename Foam::indexedOctree<Type>::volumeType
Foam::indexedOctree<Type>::getVolumeType
(
@ -3041,8 +3041,8 @@ Foam::indexedOctree<Type>::getVolumeType
}
template <class Type>
template <class CompareOp>
template<class Type>
template<class CompareOp>
void Foam::indexedOctree<Type>::findNear
(
const scalar nearDist,
@ -3066,7 +3066,7 @@ void Foam::indexedOctree<Type>::findNear
// Print contents of nodeI
template <class Type>
template<class Type>
void Foam::indexedOctree<Type>::print
(
prefixOSstream& os,
@ -3140,7 +3140,7 @@ void Foam::indexedOctree<Type>::print
// Print contents of nodeI
template <class Type>
template<class Type>
bool Foam::indexedOctree<Type>::write(Ostream& os) const
{
os << *this;
@ -3149,7 +3149,7 @@ bool Foam::indexedOctree<Type>::write(Ostream& os) const
}
template <class Type>
template<class Type>
Foam::Ostream& Foam::operator<<(Ostream& os, const indexedOctree<Type>& t)
{
return

View File

@ -65,7 +65,7 @@ TemplateName(indexedOctree);
Class indexedOctree Declaration
\*---------------------------------------------------------------------------*/
template <class Type>
template<class Type>
class indexedOctree
:
public indexedOctreeName
@ -212,7 +212,7 @@ private:
// Query
//- Find nearest point to line.
template <class FindNearestOp>
template<class FindNearestOp>
void findNearest
(
const label nodeI,
@ -297,7 +297,7 @@ private:
// intersection point.
// findAny=true : return any intersection
// findAny=false: return nearest (to start) intersection
template <class FindIntersectOp>
template<class FindIntersectOp>
void traverseNode
(
const bool findAny,
@ -316,7 +316,7 @@ private:
) const;
//- Find any or nearest intersection
template <class FindIntersectOp>
template<class FindIntersectOp>
pointIndexHit findLine
(
const bool findAny,
@ -336,7 +336,7 @@ private:
// ) const;
//- Find any or nearest intersection of line between start and end.
template <class FindIntersectOp>
template<class FindIntersectOp>
pointIndexHit findLine
(
const bool findAny,
@ -364,7 +364,7 @@ private:
) const;
template <class CompareOp>
template<class CompareOp>
static void findNear
(
const scalar nearDist,
@ -549,7 +549,7 @@ public:
// - bool : any point found nearer than nearestDistSqr
// - label: index in shapes
// - point: actual nearest point found
template <class FindNearestOp>
template<class FindNearestOp>
pointIndexHit findNearest
(
const point& sample,
@ -572,7 +572,7 @@ public:
// ) const;
//- Low level: calculate nearest starting from subnode.
template <class FindNearestOp>
template<class FindNearestOp>
void findNearest
(
const label nodeI,
@ -599,7 +599,7 @@ public:
point& linePoint
) const;
template <class FindNearestOp>
template<class FindNearestOp>
pointIndexHit findNearest
(
const linePointRef& ln,
@ -624,7 +624,7 @@ public:
) const;
//- Find nearest intersection of line between start and end.
template <class FindIntersectOp>
template<class FindIntersectOp>
pointIndexHit findLine
(
const point& start,
@ -633,7 +633,7 @@ public:
) const;
//- Find any intersection of line between start and end.
template <class FindIntersectOp>
template<class FindIntersectOp>
pointIndexHit findLineAny
(
const point& start,
@ -690,7 +690,7 @@ public:
//- Find near pairs and apply CompareOp to them.
// tree2 can be *this or different tree.
template <class CompareOp>
template<class CompareOp>
void findNear
(
const scalar nearDist,

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-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -583,7 +583,7 @@ void Foam::Distribution<Type>::operator=
// * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * * //
template <class Type>
template<class Type>
Foam::Istream& Foam::operator>>
(
Istream& is,
@ -621,7 +621,7 @@ Foam::Ostream& Foam::operator<<
// * * * * * * * * * * * * * * * Global Operators * * * * * * * * * * * * * //
template <class Type>
template<class Type>
Foam::Distribution<Type> Foam::operator+
(
const Distribution<Type>& d1,

View File

@ -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
@ -30,7 +30,7 @@ namespace Foam
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template <class AccessType, class T, class AccessOp>
template<class AccessType, class T, class AccessOp>
AccessType ListListOps::combine(const List<T>& lst, AccessOp aop)
{
label sum = 0;
@ -57,7 +57,7 @@ AccessType ListListOps::combine(const List<T>& lst, AccessOp aop)
}
template <class T, class AccessOp>
template<class T, class AccessOp>
labelList ListListOps::subSizes(const List<T>& lst, AccessOp aop)
{
labelList sizes(lst.size());
@ -70,7 +70,7 @@ labelList ListListOps::subSizes(const List<T>& lst, AccessOp aop)
}
template <class AccessType, class T, class AccessOp, class OffsetOp>
template<class AccessType, class T, class AccessOp, class OffsetOp>
AccessType ListListOps::combineOffset
(
const List<T>& lst,

View File

@ -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
@ -94,7 +94,7 @@ namespace Foam
{
// Dummy access operator for ListListOps::combine()
template <class T>
template<class T>
class accessOp
{
public:
@ -107,7 +107,7 @@ public:
// Offset operator for ListListOps::combineOffset()
template <class T>
template<class T>
class offsetOp
{
public:
@ -126,15 +126,15 @@ namespace ListListOps
{
//- Combines sublists into one big list
template <class AccessType, class T, class AccessOp>
template<class AccessType, class T, class AccessOp>
AccessType combine(const List<T>&, AccessOp aop = accessOp<T>());
//- Gets sizes of sublists
template <class T, class AccessOp>
template<class T, class AccessOp>
labelList subSizes(const List<T>&, AccessOp aop = accessOp<T>());
//- Like combine but also offsets sublists based on passed sizes
template <class AccessType, class T, class AccessOp, class OffsetOp>
template<class AccessType, class T, class AccessOp, class OffsetOp>
AccessType combineOffset
(
const List<T>&,

View File

@ -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
@ -255,23 +255,23 @@ public:
//- Reverse a list. First element becomes last element etc.
template <class ListType>
template<class ListType>
ListType reverseList(const ListType& list);
//- Inplace reversal of a list using Swap.
template <class ListType>
template<class ListType>
void inplaceReverseList(ListType& list);
//- Rotate a list by n places. If n is positive rotate clockwise/right/down.
// If n is negative rotate anti-clockwise/left/up.
template <class ListType>
template<class ListType>
ListType rotateList(const ListType& list, const label n);
//- Inplace reversal of a list using the Reversal Block Swapping algorithm.
template <template <typename> class ListType, class DataType>
template<template<typename> class ListType, class DataType>
void inplaceRotateList(ListType<DataType>& list, label n);

View File

@ -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
@ -706,7 +706,7 @@ void Foam::ListAppendEqOp<T>::operator()(List<T>& x, const List<T>& y) const
}
template <class ListType>
template<class ListType>
ListType Foam::reverseList(const ListType& list)
{
const label listSize = list.size();
@ -723,7 +723,7 @@ ListType Foam::reverseList(const ListType& list)
}
template <class ListType>
template<class ListType>
void Foam::inplaceReverseList(ListType& list)
{
const label listSize = list.size();
@ -740,7 +740,7 @@ void Foam::inplaceReverseList(ListType& list)
}
template <class ListType>
template<class ListType>
ListType Foam::rotateList(const ListType& list, const label n)
{
const label listSize = list.size();
@ -763,7 +763,7 @@ ListType Foam::rotateList(const ListType& list, const label n)
}
template <template <typename> class ListType, class DataType>
template<template<typename> class ListType, class DataType>
void Foam::inplaceRotateList(ListType<DataType>& list, label n)
{
const label listSize = list.size();

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-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -132,7 +132,9 @@ inline const T& Foam::PtrList<T>::operator[](const label i) const
if (!ptrs_[i])
{
FatalErrorIn("PtrList::operator[] const")
<< "hanging pointer, cannot dereference"
<< "hanging pointer at index " << i
<< " (size " << size()
<< "), cannot dereference"
<< abort(FatalError);
}
@ -146,7 +148,9 @@ inline T& Foam::PtrList<T>::operator[](const label i)
if (!ptrs_[i])
{
FatalErrorIn("PtrList::operator[]")
<< "hanging pointer, cannot dereference"
<< "hanging pointer at index " << i
<< " (size " << size()
<< "), cannot dereference"
<< abort(FatalError);
}

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-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -31,7 +31,7 @@ License
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
template <class Type>
template<class Type>
void Foam::ParSortableList<Type>::write
(
const List<Type>& elems,
@ -49,7 +49,7 @@ void Foam::ParSortableList<Type>::write
// Copy src, starting at destI into dest.
template <class Type>
template<class Type>
void Foam::ParSortableList<Type>::copyInto
(
const List<Type>& values,
@ -72,7 +72,7 @@ void Foam::ParSortableList<Type>::copyInto
}
template <class Type>
template<class Type>
void Foam::ParSortableList<Type>::getPivots
(
const List<Type>& elems,
@ -92,7 +92,7 @@ void Foam::ParSortableList<Type>::getPivots
}
template <class Type>
template<class Type>
void Foam::ParSortableList<Type>::checkAndSend
(
List<Type>& values,
@ -123,7 +123,7 @@ void Foam::ParSortableList<Type>::checkAndSend
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Construct from List, sorting the elements
template <class Type>
template<class Type>
Foam::ParSortableList<Type>::ParSortableList(const UList<Type>& values)
:
List<Type>(values),
@ -135,7 +135,7 @@ Foam::ParSortableList<Type>::ParSortableList(const UList<Type>& values)
// Construct given size. Sort later on.
template <class Type>
template<class Type>
Foam::ParSortableList<Type>::ParSortableList(const label size)
:
List<Type>(size),
@ -147,7 +147,7 @@ Foam::ParSortableList<Type>::ParSortableList(const label size)
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
// Sort
template <class Type>
template<class Type>
void Foam::ParSortableList<Type>::sort()
{
//

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-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -66,7 +66,7 @@ TemplateName(ParSortableList);
Class ParSortableList Declaration
\*---------------------------------------------------------------------------*/
template <class Type>
template<class Type>
class ParSortableList
:
public ParSortableListName,

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-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -107,7 +107,9 @@ inline const T& Foam::UPtrList<T>::operator[](const label i) const
if (!ptrs_[i])
{
FatalErrorIn("UPtrList::operator[] const")
<< "hanging pointer, cannot dereference"
<< "hanging pointer at index " << i
<< " (size " << size()
<< "), cannot dereference"
<< abort(FatalError);
}
@ -121,7 +123,9 @@ inline T& Foam::UPtrList<T>::operator[](const label i)
if (!ptrs_[i])
{
FatalErrorIn("UPtrList::operator[]")
<< "hanging pointer, cannot dereference"
<< "hanging pointer at index " << i
<< " (size " << size()
<< "), cannot dereference"
<< abort(FatalError);
}

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-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -148,6 +148,27 @@ Foam::IOobject* Foam::IOobjectList::lookup(const word& name) const
}
Foam::IOobjectList Foam::IOobjectList::lookupRe(const wordRe& name) const
{
IOobjectList objectsOfName(size());
forAllConstIter(HashPtrTable<IOobject>, *this, iter)
{
if (name.match(iter()->name()))
{
if (IOobject::debug)
{
Info<< "IOobjectList::lookupRe : found " << iter.key() << endl;
}
objectsOfName.insert(iter.key(), new IOobject(*iter()));
}
}
return objectsOfName;
}
Foam::IOobjectList Foam::IOobjectList::lookupClass(const word& ClassName) const
{
IOobjectList objectsOfClass(size());

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-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -44,7 +44,7 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class IOobjectList Declaration
Class IOobjectList Declaration
\*---------------------------------------------------------------------------*/
class IOobjectList
@ -91,6 +91,9 @@ public:
//- Lookup a given name and return IOobject ptr if found else NULL
IOobject* lookup(const word& name) const;
//- Return the list for all IOobects whose name matches name
IOobjectList lookupRe(const wordRe& name) const;
//- Return the list for all IOobjects of a given class
IOobjectList lookupClass(const word& className) const;

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-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -92,7 +92,7 @@ public:
//- Gather data. Apply bop to combine Value
// from different processors
template <class T, class BinaryOp>
template<class T, class BinaryOp>
static void gather
(
const List<commsStruct>& comms,
@ -102,7 +102,7 @@ public:
);
//- Like above but switches between linear/tree communication
template <class T, class BinaryOp>
template<class T, class BinaryOp>
static void gather
(
T& Value,
@ -111,7 +111,7 @@ public:
);
//- Scatter data. Distribute without modification. Reverse of gather
template <class T>
template<class T>
static void scatter
(
const List<commsStruct>& comms,
@ -120,14 +120,14 @@ public:
);
//- Like above but switches between linear/tree communication
template <class T>
template<class T>
static void scatter(T& Value, const int tag = Pstream::msgType());
// Combine variants. Inplace combine values from processors.
// (Uses construct from Istream instead of <<)
template <class T, class CombineOp>
template<class T, class CombineOp>
static void combineGather
(
const List<commsStruct>& comms,
@ -137,7 +137,7 @@ public:
);
//- Like above but switches between linear/tree communication
template <class T, class CombineOp>
template<class T, class CombineOp>
static void combineGather
(
T& Value,
@ -146,7 +146,7 @@ public:
);
//- Scatter data. Reverse of combineGather
template <class T>
template<class T>
static void combineScatter
(
const List<commsStruct>& comms,
@ -155,7 +155,7 @@ public:
);
//- Like above but switches between linear/tree communication
template <class T>
template<class T>
static void combineScatter
(
T& Value,
@ -164,7 +164,7 @@ public:
// Combine variants working on whole List at a time.
template <class T, class CombineOp>
template<class T, class CombineOp>
static void listCombineGather
(
const List<commsStruct>& comms,
@ -174,7 +174,7 @@ public:
);
//- Like above but switches between linear/tree communication
template <class T, class CombineOp>
template<class T, class CombineOp>
static void listCombineGather
(
List<T>& Value,
@ -183,7 +183,7 @@ public:
);
//- Scatter data. Reverse of combineGather
template <class T>
template<class T>
static void listCombineScatter
(
const List<commsStruct>& comms,
@ -192,7 +192,7 @@ public:
);
//- Like above but switches between linear/tree communication
template <class T>
template<class T>
static void listCombineScatter
(
List<T>& Value,
@ -202,7 +202,7 @@ public:
// Combine variants working on whole map at a time. Container needs to
// have iterators and find() defined.
template <class Container, class CombineOp>
template<class Container, class CombineOp>
static void mapCombineGather
(
const List<commsStruct>& comms,
@ -212,7 +212,7 @@ public:
);
//- Like above but switches between linear/tree communication
template <class Container, class CombineOp>
template<class Container, class CombineOp>
static void mapCombineGather
(
Container& Values,
@ -221,7 +221,7 @@ public:
);
//- Scatter data. Reverse of combineGather
template <class Container>
template<class Container>
static void mapCombineScatter
(
const List<commsStruct>& comms,
@ -230,7 +230,7 @@ public:
);
//- Like above but switches between linear/tree communication
template <class Container>
template<class Container>
static void mapCombineScatter
(
Container& Values,
@ -244,7 +244,7 @@ public:
// Values[UPstream::myProcNo()] is the data for the current processor.
//- Gather data but keep individual values separate
template <class T>
template<class T>
static void gatherList
(
const List<commsStruct>& comms,
@ -253,7 +253,7 @@ public:
);
//- Like above but switches between linear/tree communication
template <class T>
template<class T>
static void gatherList
(
List<T>& Values,
@ -261,7 +261,7 @@ public:
);
//- Scatter data. Reverse of gatherList
template <class T>
template<class T>
static void scatterList
(
const List<commsStruct>& comms,
@ -270,7 +270,7 @@ public:
);
//- Like above but switches between linear/tree communication
template <class T>
template<class T>
static void scatterList
(
List<T>& Values,
@ -284,7 +284,7 @@ public:
// sizes (not bytes). sizes[p0][p1] is what processor p0 has
// sent to p1. Continuous data only.
// If block=true will wait for all transfers to finish.
template <class Container, class T>
template<class Container, class T>
static void exchange
(
const List<Container >&,

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-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -47,7 +47,7 @@ namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template <class T, class CombineOp>
template<class T, class CombineOp>
void combineReduce
(
const List<UPstream::commsStruct>& comms,
@ -61,7 +61,7 @@ void combineReduce
}
template <class T, class CombineOp>
template<class T, class CombineOp>
void combineReduce
(
T& Value,

View File

@ -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
@ -38,7 +38,7 @@ namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Reduce operation with user specified communication schedule
template <class T, class BinaryOp>
template<class T, class BinaryOp>
void reduce
(
const List<UPstream::commsStruct>& comms,
@ -53,7 +53,7 @@ void reduce
// Reduce using either linear or tree communication schedule
template <class T, class BinaryOp>
template<class T, class BinaryOp>
void reduce
(
T& Value,
@ -73,7 +73,7 @@ void reduce
// Reduce using either linear or tree communication schedule
template <class T, class BinaryOp>
template<class T, class BinaryOp>
T returnReduce
(
const T& Value,
@ -97,7 +97,7 @@ T returnReduce
// Reduce with sum of both value and count (for averaging)
template <class T>
template<class T>
void sumReduce
(
T& Value,
@ -111,7 +111,7 @@ void sumReduce
// Non-blocking version of reduce. Sets request.
template <class T, class BinaryOp>
template<class T, class BinaryOp>
void reduce
(
T& Value,

View File

@ -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
@ -172,6 +172,13 @@ Foam::Istream& Foam::UIPstream::read(token& t)
t.type() = token::VERBATIMSTRING;
return *this;
}
case token::VARIABLE :
{
// Recurse to read actual string
read(t);
t.type() = token::VARIABLE;
return *this;
}
case token::STRING :
{
string* pval = new string;

View File

@ -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
@ -159,6 +159,11 @@ Foam::Ostream& Foam::UOPstream::write(const token& t)
write(char(token::VERBATIMSTRING));
write(t.stringToken());
}
else if (t.type() == token::VARIABLE)
{
write(char(token::VARIABLE));
write(t.stringToken());
}
else
{
notImplemented("Ostream& UOPstream::write(const token&)");

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

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-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -45,7 +45,7 @@ namespace Foam
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template <class T, class CombineOp>
template<class T, class CombineOp>
void Pstream::combineGather
(
const List<UPstream::commsStruct>& comms,
@ -129,7 +129,7 @@ void Pstream::combineGather
}
template <class T, class CombineOp>
template<class T, class CombineOp>
void Pstream::combineGather(T& Value, const CombineOp& cop, const int tag)
{
if (UPstream::nProcs() < UPstream::nProcsSimpleSum)
@ -143,7 +143,7 @@ void Pstream::combineGather(T& Value, const CombineOp& cop, const int tag)
}
template <class T>
template<class T>
void Pstream::combineScatter
(
const List<UPstream::commsStruct>& comms,
@ -214,7 +214,7 @@ void Pstream::combineScatter
}
template <class T>
template<class T>
void Pstream::combineScatter(T& Value, const int tag)
{
if (UPstream::nProcs() < UPstream::nProcsSimpleSum)
@ -232,7 +232,7 @@ void Pstream::combineScatter(T& Value, const int tag)
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
template <class T, class CombineOp>
template<class T, class CombineOp>
void Pstream::listCombineGather
(
const List<UPstream::commsStruct>& comms,
@ -323,7 +323,7 @@ void Pstream::listCombineGather
}
template <class T, class CombineOp>
template<class T, class CombineOp>
void Pstream::listCombineGather
(
List<T>& Values,
@ -342,7 +342,7 @@ void Pstream::listCombineGather
}
template <class T>
template<class T>
void Pstream::listCombineScatter
(
const List<UPstream::commsStruct>& comms,
@ -413,7 +413,7 @@ void Pstream::listCombineScatter
}
template <class T>
template<class T>
void Pstream::listCombineScatter(List<T>& Values, const int tag)
{
if (UPstream::nProcs() < UPstream::nProcsSimpleSum)
@ -433,7 +433,7 @@ void Pstream::listCombineScatter(List<T>& Values, const int tag)
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
template <class Container, class CombineOp>
template<class Container, class CombineOp>
void Pstream::mapCombineGather
(
const List<UPstream::commsStruct>& comms,
@ -499,7 +499,7 @@ void Pstream::mapCombineGather
}
template <class Container, class CombineOp>
template<class Container, class CombineOp>
void Pstream::mapCombineGather
(
Container& Values,
@ -518,7 +518,7 @@ void Pstream::mapCombineGather
}
template <class Container>
template<class Container>
void Pstream::mapCombineScatter
(
const List<UPstream::commsStruct>& comms,
@ -561,7 +561,7 @@ void Pstream::mapCombineScatter
}
template <class Container>
template<class Container>
void Pstream::mapCombineScatter(Container& Values, const int tag)
{
if (UPstream::nProcs() < UPstream::nProcsSimpleSum)

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-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -38,8 +38,8 @@ namespace Foam
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
//template <template<class> class ListType, class T>
template <class Container, class T>
//template<template<class> class ListType, class T>
template<class Container, class T>
void Pstream::exchange
(
const List<Container>& sendBufs,

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-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -42,7 +42,7 @@ namespace Foam
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template <class T, class BinaryOp>
template<class T, class BinaryOp>
void Pstream::gather
(
const List<UPstream::commsStruct>& comms,
@ -111,7 +111,7 @@ void Pstream::gather
}
template <class T, class BinaryOp>
template<class T, class BinaryOp>
void Pstream::gather(T& Value, const BinaryOp& bop, const int tag)
{
if (UPstream::nProcs() < UPstream::nProcsSimpleSum)
@ -125,7 +125,7 @@ void Pstream::gather(T& Value, const BinaryOp& bop, const int tag)
}
template <class T>
template<class T>
void Pstream::scatter
(
const List<UPstream::commsStruct>& comms,
@ -189,7 +189,7 @@ void Pstream::scatter
}
template <class T>
template<class T>
void Pstream::scatter(T& Value, const int tag)
{
if (UPstream::nProcs() < UPstream::nProcsSimpleSum)

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-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -44,7 +44,7 @@ namespace Foam
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template <class T>
template<class T>
void Pstream::gatherList
(
const List<UPstream::commsStruct>& comms,
@ -179,7 +179,7 @@ void Pstream::gatherList
}
template <class T>
template<class T>
void Pstream::gatherList(List<T>& Values, const int tag)
{
if (UPstream::nProcs() < UPstream::nProcsSimpleSum)
@ -193,7 +193,7 @@ void Pstream::gatherList(List<T>& Values, const int tag)
}
template <class T>
template<class T>
void Pstream::scatterList
(
const List<UPstream::commsStruct>& comms,
@ -307,7 +307,7 @@ void Pstream::scatterList
}
template <class T>
template<class T>
void Pstream::scatterList(List<T>& Values, const int tag)
{
if (UPstream::nProcs() < UPstream::nProcsSimpleSum)

View File

@ -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
@ -39,6 +39,10 @@ Foam::Ostream& Foam::OSstream::write(const token& t)
write(char(token::HASH));
write(char(token::END_BLOCK));
}
else if (t.type() == token::VARIABLE)
{
writeQuoted( t.stringToken(), false);
}
return *this;
}

View File

@ -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
@ -75,6 +75,10 @@ Foam::Ostream& Foam::prefixOSstream::write(const token& t)
write(char(token::HASH));
write(char(token::END_BLOCK));
}
else if (t.type() == token::VARIABLE)
{
writeQuoted(t.stringToken(), false);
}
return *this;
}

View File

@ -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
@ -75,8 +75,8 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const token& t)
break;
case token::VARIABLE:
// Write variable as word so without ""
os.writeQuoted(*t.stringTokenPtr_, false);
// Behaviour differs according to stream type
os.write(t);
break;
case token::LABEL:

View File

@ -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
@ -30,6 +30,8 @@ License
#include "inputModeEntry.H"
#include "stringOps.H"
#include "IOstreams.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
bool Foam::entry::getKeyword(keyType& keyword, Istream& is)
@ -114,6 +116,9 @@ bool Foam::entry::New(dictionary& parentDict, Istream& is)
&& keyword[0] == '$'
) // ... Substitution entry
{
token nextToken(is);
is.putBack(nextToken);
if (keyword.size() > 2 && keyword[1] == token::BEGIN_BLOCK)
{
// Recursive substitution mode. Replace between {} with
@ -125,7 +130,48 @@ bool Foam::entry::New(dictionary& parentDict, Istream& is)
stringOps::inplaceExpand(s, parentDict, true, false);
keyword.std::string::replace(1, keyword.size()-1, s);
}
parentDict.substituteScopedKeyword(keyword);
if (nextToken == token::BEGIN_BLOCK)
{
word varName = keyword(1, keyword.size()-1);
// lookup the variable name in the given dictionary
const entry* ePtr = parentDict.lookupScopedEntryPtr
(
varName,
true,
true
);
if (ePtr)
{
// Read as primitiveEntry
const word newKeyword(ePtr->stream());
return parentDict.add
(
new dictionaryEntry(newKeyword, parentDict, is),
false
);
}
else
{
FatalIOErrorIn
(
"entry::New(const dictionary& parentDict, Istream&)",
is
)
<< "Attempt to use undefined variable " << varName
<< " as keyword"
<< exit(FatalIOError);
return false;
}
}
else
{
parentDict.substituteScopedKeyword(keyword);
}
return true;
}
else if

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -26,6 +26,7 @@ License
#include "functionObjectFile.H"
#include "Time.H"
#include "polyMesh.H"
#include "IFstream.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -84,7 +85,16 @@ void Foam::functionObjectFile::createFiles()
mkDir(outputDir);
filePtrs_.set(i, new OFstream(outputDir/(iter.key() + ".dat")));
word fName(iter.key());
// check if file already exists
IFstream is(outputDir/(fName + ".dat"));
if (is.good())
{
fName = fName + "_" + obr_.time().timeName();
}
filePtrs_.set(i, new OFstream(outputDir/(fName + ".dat")));
writeFileHeader(i);
}

View File

@ -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
@ -159,6 +159,14 @@ public:
template<class Type>
HashTable<const Type*> lookupClass(const bool strict = false) const;
//- Lookup and return all objects of the given Type
template<class Type>
HashTable<Type*> lookupClass(const bool strict = false);
//- Return the list of objects whose name matches the input regExp
template<class Type>
wordList foundObjectRe(const wordRe& name) const;
//- Is the named Type found?
template<class Type>
bool foundObject(const word& name) const;

View File

@ -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
@ -76,6 +76,34 @@ Foam::HashTable<const Type*> Foam::objectRegistry::lookupClass
}
template<class Type>
Foam::HashTable<Type*> Foam::objectRegistry::lookupClass
(
const bool strict
)
{
HashTable<Type*> objectsOfClass(size());
forAllIter(HashTable<regIOobject*>, *this, iter)
{
if
(
(strict && isType<Type>(*iter()))
|| (!strict && isA<Type>(*iter()))
)
{
objectsOfClass.insert
(
iter()->name(),
dynamic_cast<Type*>(iter())
);
}
}
return objectsOfClass;
}
template<class Type>
bool Foam::objectRegistry::foundObject(const word& name) const
{
@ -99,6 +127,31 @@ bool Foam::objectRegistry::foundObject(const word& name) const
}
template<class Type>
Foam::wordList Foam::objectRegistry::foundObjectRe(const wordRe& name) const
{
wordList objectNames(size());
label count = 0;
forAllConstIter(HashTable<regIOobject*>, *this, iter)
{
if (isA<Type>(*iter()))
{
const word& objectName = iter()->name();
if (name.match(objectName))
{
objectNames[count++] = objectName;
}
}
}
objectNames.setSize(count);
return objectNames;
}
template<class Type>
const Type& Foam::objectRegistry::lookupObject(const word& name) const
{

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-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -20,7 +20,6 @@ License
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Dimensioned sphericalTensor obtained from generic dimensioned type.
\*---------------------------------------------------------------------------*/

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-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -20,7 +20,6 @@ License
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Dimensioned tensor obtained from generic dimensioned type.
\*---------------------------------------------------------------------------*/

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-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -20,7 +20,6 @@ License
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Dimensioned tensor obtained from generic dimensioned type.
\*---------------------------------------------------------------------------*/

View File

@ -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
@ -34,7 +34,7 @@ namespace Foam
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
template <class Type>
template<class Type>
dimensioned<Type> dimensioned<Type>::lookupOrDefault
(
const word& name,
@ -48,7 +48,7 @@ dimensioned<Type> dimensioned<Type>::lookupOrDefault
}
template <class Type>
template<class Type>
dimensioned<Type> dimensioned<Type>::lookupOrAddToDict
(
const word& name,
@ -64,7 +64,7 @@ dimensioned<Type> dimensioned<Type>::lookupOrAddToDict
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template <class Type>
template<class Type>
dimensioned<Type>::dimensioned
(
const word& name,
@ -78,7 +78,7 @@ dimensioned<Type>::dimensioned
{}
template <class Type>
template<class Type>
dimensioned<Type>::dimensioned
(
const word& name,
@ -91,7 +91,7 @@ dimensioned<Type>::dimensioned
{}
template <class Type>
template<class Type>
dimensioned<Type>::dimensioned
(
Istream& is
@ -103,7 +103,7 @@ dimensioned<Type>::dimensioned
}
template <class Type>
template<class Type>
dimensioned<Type>::dimensioned
(
const word& name,
@ -120,7 +120,7 @@ dimensioned<Type>::dimensioned
}
template <class Type>
template<class Type>
dimensioned<Type>::dimensioned
(
const word& name,
@ -171,7 +171,7 @@ dimensioned<Type>::dimensioned
}
template <class Type>
template<class Type>
dimensioned<Type>::dimensioned
()
:
@ -183,46 +183,46 @@ dimensioned<Type>::dimensioned
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template <class Type>
template<class Type>
const word& dimensioned<Type>::name() const
{
return name_;
}
template <class Type>
template<class Type>
word& dimensioned<Type>::name()
{
return name_;
}
template <class Type>
template<class Type>
const dimensionSet& dimensioned<Type>::dimensions() const
{
return dimensions_;
}
template <class Type>
template<class Type>
dimensionSet& dimensioned<Type>::dimensions()
{
return dimensions_;
}
template <class Type>
template<class Type>
const Type& dimensioned<Type>::value() const
{
return value_;
}
template <class Type>
template<class Type>
Type& dimensioned<Type>::value()
{
return value_;
}
template <class Type>
template<class Type>
dimensioned<typename dimensioned<Type>::cmptType> dimensioned<Type>::component
(
const direction d
@ -237,7 +237,7 @@ dimensioned<typename dimensioned<Type>::cmptType> dimensioned<Type>::component
}
template <class Type>
template<class Type>
void dimensioned<Type>::replace
(
const direction d,
@ -249,14 +249,14 @@ void dimensioned<Type>::replace
}
template <class Type>
template<class Type>
bool dimensioned<Type>::readIfPresent(const dictionary& dict)
{
return dict.readIfPresent(name_, value_);
}
template <class Type>
template<class Type>
Foam::Istream& dimensioned<Type>::read(Istream& is, const dictionary& readSet)
{
// Read name
@ -280,7 +280,7 @@ Foam::Istream& dimensioned<Type>::read(Istream& is, const dictionary& readSet)
}
template <class Type>
template<class Type>
Foam::Istream& dimensioned<Type>::read
(
Istream& is,
@ -309,7 +309,7 @@ Foam::Istream& dimensioned<Type>::read
}
template <class Type>
template<class Type>
Foam::Istream& dimensioned<Type>::read(Istream& is)
{
// Read name
@ -335,7 +335,7 @@ Foam::Istream& dimensioned<Type>::read(Istream& is)
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
template <class Type>
template<class Type>
dimensioned<typename dimensioned<Type>::cmptType> dimensioned<Type>::operator[]
(
const direction d
@ -345,7 +345,7 @@ dimensioned<typename dimensioned<Type>::cmptType> dimensioned<Type>::operator[]
}
template <class Type>
template<class Type>
void dimensioned<Type>::operator+=
(
const dimensioned<Type>& dt
@ -356,7 +356,7 @@ void dimensioned<Type>::operator+=
}
template <class Type>
template<class Type>
void dimensioned<Type>::operator-=
(
const dimensioned<Type>& dt
@ -367,7 +367,7 @@ void dimensioned<Type>::operator-=
}
template <class Type>
template<class Type>
void dimensioned<Type>::operator*=
(
const scalar s
@ -377,7 +377,7 @@ void dimensioned<Type>::operator*=
}
template <class Type>
template<class Type>
void dimensioned<Type>::operator/=
(
const scalar s
@ -436,7 +436,7 @@ dimensioned<scalar> mag(const dimensioned<Type>& dt)
}
template <class Type>
template<class Type>
dimensioned<Type> max
(
const dimensioned<Type>& dt1,
@ -459,7 +459,7 @@ dimensioned<Type> max
}
template <class Type>
template<class Type>
dimensioned<Type> min
(
const dimensioned<Type>& dt1,
@ -484,7 +484,7 @@ dimensioned<Type> min
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
template <class Type>
template<class Type>
Istream& operator>>(Istream& is, dimensioned<Type>& dt)
{
token nextToken(is);
@ -517,7 +517,7 @@ Istream& operator>>(Istream& is, dimensioned<Type>& dt)
}
template <class Type>
template<class Type>
Ostream& operator<<(Ostream& os, const dimensioned<Type>& dt)
{
// Write the name
@ -541,7 +541,7 @@ Ostream& operator<<(Ostream& os, const dimensioned<Type>& dt)
// * * * * * * * * * * * * * * * Global Operators * * * * * * * * * * * * * //
template <class Type>
template<class Type>
bool operator>
(
const dimensioned<Type>& dt1,
@ -552,7 +552,7 @@ bool operator>
}
template <class Type>
template<class Type>
bool operator<
(
const dimensioned<Type>& dt1,
@ -563,7 +563,7 @@ bool operator<
}
template <class Type>
template<class Type>
dimensioned<Type> operator+
(
const dimensioned<Type>& dt1,
@ -579,7 +579,7 @@ dimensioned<Type> operator+
}
template <class Type>
template<class Type>
dimensioned<Type> operator-(const dimensioned<Type>& dt)
{
return dimensioned<Type>
@ -591,7 +591,7 @@ dimensioned<Type> operator-(const dimensioned<Type>& dt)
}
template <class Type>
template<class Type>
dimensioned<Type> operator-
(
const dimensioned<Type>& dt1,
@ -607,7 +607,7 @@ dimensioned<Type> operator-
}
template <class Type>
template<class Type>
dimensioned<Type> operator*
(
const dimensioned<scalar>& ds,
@ -623,7 +623,7 @@ dimensioned<Type> operator*
}
template <class Type>
template<class Type>
dimensioned<Type> operator/
(
const dimensioned<Type>& dt,

View File

@ -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
@ -61,7 +61,7 @@ class dictionary;
Class dimensioned Declaration
\*---------------------------------------------------------------------------*/
template <class Type>
template<class Type>
class dimensioned
{
// private data

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-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -27,7 +27,7 @@ License
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template <class T>
template<class T>
Foam::List<T> Foam::transform
(
const tensor& rotTensor,
@ -45,7 +45,7 @@ Foam::List<T> Foam::transform
}
template <class T>
template<class T>
void Foam::transformList(const tensor& rotTensor, UList<T>& field)
{
forAll(field, i)
@ -55,7 +55,7 @@ void Foam::transformList(const tensor& rotTensor, UList<T>& field)
}
template <class T>
template<class T>
void Foam::transformList(const tensorField& rotTensor, UList<T>& field)
{
if (rotTensor.size() == 1)
@ -84,7 +84,7 @@ void Foam::transformList(const tensorField& rotTensor, UList<T>& field)
}
template <class T>
template<class T>
void Foam::transformList(const tensor& rotTensor, Map<T>& field)
{
forAllIter(typename Map<T>, field, iter)
@ -94,7 +94,7 @@ void Foam::transformList(const tensor& rotTensor, Map<T>& field)
}
template <class T>
template<class T>
void Foam::transformList(const tensorField& rotTensor, Map<T>& field)
{
if (rotTensor.size() == 1)
@ -116,7 +116,7 @@ void Foam::transformList(const tensorField& rotTensor, Map<T>& field)
}
template <class T>
template<class T>
void Foam::transformList(const tensor& rotTensor, EdgeMap<T>& field)
{
forAllIter(typename EdgeMap<T>, field, iter)
@ -126,7 +126,7 @@ void Foam::transformList(const tensor& rotTensor, EdgeMap<T>& field)
}
template <class T>
template<class T>
void Foam::transformList(const tensorField& rotTensor, EdgeMap<T>& field)
{
if (rotTensor.size() == 1)

View File

@ -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
@ -146,7 +146,8 @@ bool Foam::GeometricField<Type, PatchField, GeoMesh>::readOldTimeIfPresent()
this->time().timeName(),
this->db(),
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
IOobject::AUTO_WRITE,
this->registerObject()
);
if (field0.headerOk())
@ -761,7 +762,10 @@ Foam::GeometricField<Type, PatchField, GeoMesh>::oldTime() const
(
this->name() + "_0",
this->time().timeName(),
this->db()
this->db(),
IOobject::NO_READ,
IOobject::NO_WRITE,
this->registerObject()
),
*this
);

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-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -24,7 +24,6 @@ License
\*---------------------------------------------------------------------------*/
#include "processorPointPatchField.H"
//#include "transformField.H"
#include "processorPolyPatch.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -92,73 +91,6 @@ processorPointPatchField<Type>::~processorPointPatchField()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type>
void processorPointPatchField<Type>::initSwapAddSeparated
(
const Pstream::commsTypes commsType,
Field<Type>& pField
)
const
{
// if (Pstream::parRun())
// {
// // Get internal field into correct order for opposite side
// Field<Type> pf
// (
// this->patchInternalField
// (
// pField,
// procPatch_.reverseMeshPoints()
// )
// );
//
// OPstream::write
// (
// commsType,
// procPatch_.neighbProcNo(),
// reinterpret_cast<const char*>(pf.begin()),
// pf.byteSize(),
// procPatch_.tag()
// );
// }
}
template<class Type>
void processorPointPatchField<Type>::swapAddSeparated
(
const Pstream::commsTypes commsType,
Field<Type>& pField
) const
{
// if (Pstream::parRun())
// {
// Field<Type> pnf(this->size());
//
// IPstream::read
// (
// commsType,
// procPatch_.neighbProcNo(),
// reinterpret_cast<char*>(pnf.begin()),
// pnf.byteSize(),
// procPatch_.tag()
// );
//
// if (doTransform())
// {
// const processorPolyPatch& ppp = procPatch_.procPolyPatch();
// const tensor& forwardT = ppp.forwardT();
//
// transform(pnf, forwardT, pnf);
// }
//
// addToInternalField(pField, pnf, procPatch_.separatedPoints());
// }
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam

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-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -57,7 +57,6 @@ class processorPointPatchField
//- Local reference to processor patch
const processorPointPatch& procPatch_;
public:
//- Runtime type information
@ -176,19 +175,13 @@ public:
)
{}
//- Initialise swap of non-collocated patch point values
virtual void initSwapAddSeparated
(
const Pstream::commsTypes commsType,
Field<Type>&
) const;
//- Complete swap of patch point values and add to local values
//- Assume processor patch always collocated
virtual void swapAddSeparated
(
const Pstream::commsTypes commsType,
Field<Type>&
) const;
) const
{}
};

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-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -38,7 +38,8 @@ Foam::processorCyclicPointPatchField<Type>::processorCyclicPointPatchField
)
:
coupledPointPatchField<Type>(p, iF),
procPatch_(refCast<const processorCyclicPointPatch>(p))
procPatch_(refCast<const processorCyclicPointPatch>(p)),
receiveBuf_(0)
{}
@ -51,7 +52,8 @@ Foam::processorCyclicPointPatchField<Type>::processorCyclicPointPatchField
)
:
coupledPointPatchField<Type>(p, iF, dict),
procPatch_(refCast<const processorCyclicPointPatch>(p))
procPatch_(refCast<const processorCyclicPointPatch>(p)),
receiveBuf_(0)
{}
@ -65,7 +67,8 @@ Foam::processorCyclicPointPatchField<Type>::processorCyclicPointPatchField
)
:
coupledPointPatchField<Type>(ptf, p, iF, mapper),
procPatch_(refCast<const processorCyclicPointPatch>(ptf.patch()))
procPatch_(refCast<const processorCyclicPointPatch>(ptf.patch())),
receiveBuf_(0)
{}
@ -77,7 +80,8 @@ Foam::processorCyclicPointPatchField<Type>::processorCyclicPointPatchField
)
:
coupledPointPatchField<Type>(ptf, iF),
procPatch_(refCast<const processorCyclicPointPatch>(ptf.patch()))
procPatch_(refCast<const processorCyclicPointPatch>(ptf.patch())),
receiveBuf_(0)
{}
@ -109,6 +113,18 @@ void Foam::processorCyclicPointPatchField<Type>::initSwapAddSeparated
)
);
if (commsType == Pstream::nonBlocking)
{
receiveBuf_.setSize(pf.size());
IPstream::read
(
commsType,
procPatch_.neighbProcNo(),
reinterpret_cast<char*>(receiveBuf_.begin()),
receiveBuf_.byteSize(),
procPatch_.tag()
);
}
OPstream::write
(
commsType,
@ -130,16 +146,19 @@ void Foam::processorCyclicPointPatchField<Type>::swapAddSeparated
{
if (Pstream::parRun())
{
Field<Type> pnf(this->size());
IPstream::read
(
commsType,
procPatch_.neighbProcNo(),
reinterpret_cast<char*>(pnf.begin()),
pnf.byteSize(),
procPatch_.tag()
);
// If nonblocking data has already been received into receiveBuf_
if (commsType != Pstream::nonBlocking)
{
receiveBuf_.setSize(this->size());
IPstream::read
(
commsType,
procPatch_.neighbProcNo(),
reinterpret_cast<char*>(receiveBuf_.begin()),
receiveBuf_.byteSize(),
procPatch_.tag()
);
}
if (doTransform())
{
@ -147,11 +166,11 @@ void Foam::processorCyclicPointPatchField<Type>::swapAddSeparated
procPatch_.procCyclicPolyPatch();
const tensor& forwardT = ppp.forwardT()[0];
transform(pnf, forwardT, pnf);
transform(receiveBuf_, forwardT, receiveBuf_);
}
// All points are separated
this->addToInternalField(pField, pnf);
this->addToInternalField(pField, receiveBuf_);
}
}

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-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -57,6 +57,9 @@ class processorCyclicPointPatchField
//- Local reference to processor patch
const processorCyclicPointPatch& procPatch_;
//- Receive buffer for non-blocking communication
mutable Field<Type> receiveBuf_;
public:

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -38,7 +38,11 @@ Description
code
#{
operator==(min(10, 0.1*this->db().time().value()));
operator==
(
vector(0,0,1)
*min(10, 0.1*this->db().time().value())
);
#};
//codeInclude

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -95,10 +95,18 @@ Foam::dictionary& Foam::debug::controlDict()
controlDictPtr_ = new dictionary();
forAllReverse(controlDictFiles, cdfi)
{
controlDictPtr_->merge
(
dictionary(IFstream(controlDictFiles[cdfi])())
);
IFstream ifs(controlDictFiles[cdfi]);
if (!ifs.good())
{
SafeFatalIOErrorIn
(
"debug::controlDict()",
ifs,
"Cannot open controlDict"
);
}
controlDictPtr_->merge(dictionary(ifs));
}
}

View File

@ -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
@ -28,7 +28,7 @@ License
\section about About OpenFOAM
OpenFOAM is a free, open source CFD software package released free and
open-source under the GNU General Public License by the OpenFOAM Foundation,
open-source under the GNU General Public License by the,
<a href="http://www.openfoam.org">OpenFOAM Foundation</a>. It has a large
user base across most areas of engineering and science, from both commercial
and academic organisations. OpenFOAM has an extensive range of features to

View File

@ -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
@ -41,6 +41,17 @@ namespace Foam
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
Foam::word Foam::graph::wordify(const Foam::string& sname)
{
string wname = sname;
wname.replace(' ', '_');
wname.replace('(', '_');
wname.replace(')', "");
return word(wname);
}
void Foam::graph::readCurves(Istream& is)
{
List<xy> xyData(is);
@ -54,7 +65,11 @@ void Foam::graph::readCurves(Istream& is)
y[i] = xyData[i].y_;
}
insert(yName_, new curve(yName_, curve::curveStyle::CONTINUOUS, y));
insert
(
wordify(yName_),
new curve(wordify(yName_), curve::curveStyle::CONTINUOUS, y)
);
}
@ -89,7 +104,7 @@ Foam::graph::graph
yName_(yName),
x_(x)
{
insert(yName, new curve(yName, curve::curveStyle::CONTINUOUS, y));
insert(wordify(yName), new curve(yName, curve::curveStyle::CONTINUOUS, y));
}

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-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -263,6 +263,9 @@ public:
const word& format
) const;
//- Helper function to convert string name into appropriate word
static word wordify(const string& sname);
// Friend operators

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-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -26,7 +26,7 @@ License
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
template <class Type>
template<class Type>
Foam::label Foam::interpolationLookUpTable<Type>::index
(
const List<scalar>& indices,
@ -70,7 +70,7 @@ Foam::label Foam::interpolationLookUpTable<Type>::index
}
template <class Type>
template<class Type>
Foam::label Foam::interpolationLookUpTable<Type>::index
(
const scalar indice

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-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -28,7 +28,7 @@ License
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
template <class Type>
template<class Type>
void Foam::uniformInterpolationTable<Type>::checkTable() const
{
if (size() < 2)
@ -44,7 +44,7 @@ void Foam::uniformInterpolationTable<Type>::checkTable() const
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template <class Type>
template<class Type>
Foam::uniformInterpolationTable<Type>::uniformInterpolationTable
(
const IOobject& io,
@ -73,7 +73,7 @@ Foam::uniformInterpolationTable<Type>::uniformInterpolationTable
}
template <class Type>
template<class Type>
Foam::uniformInterpolationTable<Type>::uniformInterpolationTable
(
const word& tableName,
@ -112,7 +112,7 @@ Foam::uniformInterpolationTable<Type>::uniformInterpolationTable
}
template <class Type>
template<class Type>
Foam::uniformInterpolationTable<Type>::uniformInterpolationTable
(
const uniformInterpolationTable& uit
@ -131,14 +131,14 @@ Foam::uniformInterpolationTable<Type>::uniformInterpolationTable
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template <class Type>
template<class Type>
Foam::uniformInterpolationTable<Type>::~uniformInterpolationTable()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
template <class Type>
template<class Type>
Type Foam::uniformInterpolationTable<Type>::interpolate(scalar x) const
{
if (bound_)
@ -186,7 +186,7 @@ Type Foam::uniformInterpolationTable<Type>::interpolate(scalar x) const
}
template <class Type>
template<class Type>
Type Foam::uniformInterpolationTable<Type>::interpolateLog10
(
scalar x
@ -217,7 +217,7 @@ Type Foam::uniformInterpolationTable<Type>::interpolateLog10
}
template <class Type>
template<class Type>
void Foam::uniformInterpolationTable<Type>::write() const
{
IOdictionary dict(*this);

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-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -67,7 +67,7 @@ namespace Foam
Class uniformInterpolationTable Declaration
\*---------------------------------------------------------------------------*/
template <class Type>
template<class Type>
class uniformInterpolationTable
:
public IOobject,

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-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -23,70 +23,70 @@ License
\*---------------------------------------------------------------------------*/
template <class Type>
template<class Type>
Foam::scalar Foam::uniformInterpolationTable<Type>::x0() const
{
return x0_;
}
template <class Type>
template<class Type>
Foam::scalar Foam::uniformInterpolationTable<Type>::dx() const
{
return dx_;
}
template <class Type>
template<class Type>
const Foam::Switch& Foam::uniformInterpolationTable<Type>::log10() const
{
return log10_;
}
template <class Type>
template<class Type>
const Foam::Switch& Foam::uniformInterpolationTable<Type>::bound() const
{
return bound_;
}
template <class Type>
template<class Type>
Foam::scalar& Foam::uniformInterpolationTable<Type>::x0()
{
return x0_;
}
template <class Type>
template<class Type>
Foam::scalar& Foam::uniformInterpolationTable<Type>::dx()
{
return dx_;
}
template <class Type>
template<class Type>
Foam::Switch& Foam::uniformInterpolationTable<Type>::log10()
{
return log10_;
}
template <class Type>
template<class Type>
Foam::Switch& Foam::uniformInterpolationTable<Type>::bound()
{
return bound_;
}
template <class Type>
template<class Type>
Foam::scalar Foam::uniformInterpolationTable<Type>::xMin() const
{
return x0_;
}
template <class Type>
template<class Type>
Foam::scalar Foam::uniformInterpolationTable<Type>::xMax() const
{
return x0_ + dx_*(size() - 1);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

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-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -70,7 +70,7 @@ Foam::GAMGAgglomeration::GAMGAgglomeration
const dictionary& controlDict
)
:
MeshObject<lduMesh, GAMGAgglomeration>(mesh),
MeshObject<lduMesh, Foam::GeometricMeshObject, GAMGAgglomeration>(mesh),
maxLevels_(50),

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-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -58,7 +58,7 @@ class lduMatrix;
class GAMGAgglomeration
:
public MeshObject<lduMesh, GAMGAgglomeration>
public MeshObject<lduMesh, GeometricMeshObject, GAMGAgglomeration>
{
protected:

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

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-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -25,29 +25,22 @@ License
#include "MeshObject.H"
#include "objectRegistry.H"
#include "IOstreams.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Mesh, class Type>
Foam::MeshObject<Mesh, Type>::MeshObject(const Mesh& mesh)
template<class Mesh, template<class> class MeshObjectType, class Type>
Foam::MeshObject<Mesh, MeshObjectType, Type>::MeshObject(const Mesh& mesh)
:
regIOobject
(
IOobject
(
Type::typeName,
mesh.thisDb().instance(),
mesh.thisDb()
)
),
MeshObjectType<Mesh>(Type::typeName, mesh.thisDb()),
mesh_(mesh)
{}
// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
template<class Mesh, class Type>
const Type& Foam::MeshObject<Mesh, Type>::New
template<class Mesh, template<class> class MeshObjectType, class Type>
const Type& Foam::MeshObject<Mesh, MeshObjectType, Type>::New
(
const Mesh& mesh
)
@ -67,14 +60,19 @@ const Type& Foam::MeshObject<Mesh, Type>::New
}
else
{
return store(new Type(mesh));
if (meshObject::debug)
{
Pout<< "MeshObject::New(const Mesh&) : constructing new "
<< Type::typeName << endl;
}
return regIOobject::store(new Type(mesh));
}
}
template<class Mesh, class Type>
template<class Mesh, template<class> class MeshObjectType, class Type>
template<class Data1>
const Type& Foam::MeshObject<Mesh, Type>::New
const Type& Foam::MeshObject<Mesh, MeshObjectType, Type>::New
(
const Mesh& mesh,
const Data1& d
@ -95,14 +93,19 @@ const Type& Foam::MeshObject<Mesh, Type>::New
}
else
{
return store(new Type(mesh, d));
if (meshObject::debug)
{
Pout<< "MeshObject::New(const Mesh&) : constructing new "
<< Type::typeName << endl;
}
return regIOobject::store(new Type(mesh, d));
}
}
template<class Mesh, class Type>
template<class Mesh, template<class> class MeshObjectType, class Type>
template<class Data1, class Data2>
const Type& Foam::MeshObject<Mesh, Type>::New
const Type& Foam::MeshObject<Mesh, MeshObjectType, Type>::New
(
const Mesh& mesh,
const Data1& d1,
@ -124,14 +127,19 @@ const Type& Foam::MeshObject<Mesh, Type>::New
}
else
{
return store(new Type(mesh, d1, d2));
if (meshObject::debug)
{
Pout<< "MeshObject(const Mesh&) : constructing new "
<< Type::typeName << endl;
}
return regIOobject::store(new Type(mesh, d1, d2));
}
}
template<class Mesh, class Type>
template<class Mesh, template<class> class MeshObjectType, class Type>
template<class Data1, class Data2, class Data3>
const Type& Foam::MeshObject<Mesh, Type>::New
const Type& Foam::MeshObject<Mesh, MeshObjectType, Type>::New
(
const Mesh& mesh,
const Data1& d1,
@ -154,14 +162,19 @@ const Type& Foam::MeshObject<Mesh, Type>::New
}
else
{
return store(new Type(mesh, d1, d2, d3));
if (meshObject::debug)
{
Pout<< "MeshObject(const Mesh&) : constructing new "
<< Type::typeName << endl;
}
return regIOobject::store(new Type(mesh, d1, d2, d3));
}
}
template<class Mesh, class Type>
template<class Mesh, template<class> class MeshObjectType, class Type>
template<class Data1, class Data2, class Data3, class Data4>
const Type& Foam::MeshObject<Mesh, Type>::New
const Type& Foam::MeshObject<Mesh, MeshObjectType, Type>::New
(
const Mesh& mesh,
const Data1& d1,
@ -185,15 +198,20 @@ const Type& Foam::MeshObject<Mesh, Type>::New
}
else
{
return store(new Type(mesh, d1, d2, d3, d4));
if (meshObject::debug)
{
Pout<< "MeshObject(const Mesh&) : constructing new "
<< Type::typeName << endl;
}
return regIOobject::store(new Type(mesh, d1, d2, d3, d4));
}
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * //
template<class Mesh, class Type>
bool Foam::MeshObject<Mesh, Type>::Delete(const Mesh& mesh)
template<class Mesh, template<class> class MeshObjectType, class Type>
bool Foam::MeshObject<Mesh, MeshObjectType, Type>::Delete(const Mesh& mesh)
{
if
(
@ -203,6 +221,12 @@ bool Foam::MeshObject<Mesh, Type>::Delete(const Mesh& mesh)
)
)
{
if (meshObject::debug)
{
Pout<< "MeshObject::Delete(const Mesh&) : deleting "
<< Type::typeName << endl;
}
return mesh.thisDb().checkOut
(
const_cast<Type&>
@ -221,10 +245,107 @@ bool Foam::MeshObject<Mesh, Type>::Delete(const Mesh& mesh)
}
template<class Mesh, class Type>
Foam::MeshObject<Mesh, Type>::~MeshObject()
template<class Mesh, template<class> class MeshObjectType, class Type>
Foam::MeshObject<Mesh, MeshObjectType, Type>::~MeshObject()
{
release();
MeshObjectType<Mesh>::release();
}
template<class Mesh>
void Foam::meshObject::movePoints(objectRegistry& obr)
{
HashTable<GeometricMeshObject<Mesh>*> meshObjects
(
obr.lookupClass<GeometricMeshObject<Mesh> >()
);
forAllIter
(
typename HashTable<GeometricMeshObject<Mesh>*>,
meshObjects,
iter
)
{
if (isA<MoveableMeshObject<Mesh> >(*iter()))
{
if (meshObject::debug)
{
Pout<< "meshObject::movePoints(objectRegistry&) :"
<< " movePoints on "
<< iter()->name() << endl;
}
dynamic_cast<MoveableMeshObject<Mesh>*>(iter())->movePoints();
}
else
{
if (meshObject::debug)
{
Pout<< "meshObject::movePoints(objectRegistry&) :"
<< " destroying "
<< iter()->name() << endl;
}
obr.checkOut(*iter());
}
}
}
template<class Mesh>
void Foam::meshObject::updateMesh(objectRegistry& obr, const mapPolyMesh& mpm)
{
HashTable<GeometricMeshObject<Mesh>*> meshObjects
(
obr.lookupClass<GeometricMeshObject<Mesh> >()
);
forAllIter
(
typename HashTable<GeometricMeshObject<Mesh>*>,
meshObjects,
iter
)
{
if (isA<UpdateableMeshObject<Mesh> >(*iter()))
{
if (meshObject::debug)
{
Pout<< "meshObject::updateMesh(objectRegistry&) :"
<< " updateMesh on "
<< iter()->name() << endl;
}
dynamic_cast<UpdateableMeshObject<Mesh>*>(iter())->updateMesh(mpm);
}
else
{
if (meshObject::debug)
{
Pout<< "meshObject::updateMesh(objectRegistry&) : destroying "
<< iter()->name() << endl;
}
obr.checkOut(*iter());
}
}
}
template<class Mesh, template<class> class MeshObjectType>
void Foam::meshObject::clear(objectRegistry& obr)
{
HashTable<MeshObjectType<Mesh>*> meshObjects
(
obr.lookupClass<MeshObjectType<Mesh> >()
);
forAllIter(typename HashTable<MeshObjectType<Mesh>*>, meshObjects, iter)
{
if (meshObject::debug)
{
Pout<< "meshObject::clear(objectRegistry&) : destroying "
<< iter()->name() << endl;
}
obr.checkOut(*iter());
}
}

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-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -25,9 +25,36 @@ Class
Foam::MeshObject
Description
Templated abstract base-class for dynamic mesh objects used to automate
Templated abstract base-class for optional mesh objects used to automate
their allocation to the mesh database and the mesh-modifier event-loop.
MeshObject is templated on the type of mesh it is allocated to, the type of
the mesh object (TopologicalMeshObject, GeometricMeshObject,
MoveableMeshObject, UpdateableMeshObject) and the type of the actual object
it is created for example:
class leastSquaresVectors
:
public MeshObject<fvMesh, MoveableMeshObject, leastSquaresVectors>
{
.
.
.
//- Delete the least square vectors when the mesh moves
virtual bool movePoints();
};
MeshObject types:
TopologicalMeshObject: mesh object to be deleted on topology change
GeometricMeshObject: mesh object to be deleted on geometry change
MoveableMeshObject: mesh object to be updated in movePoints
UpdateableMeshObject: mesh object to be updated in updateMesh or movePoints
Note that movePoints must be provided for MeshObjects of type
MoveableMeshObject and both movePoints and updateMesh functions must exist
provided for MeshObjects of type UpdateableMeshObject.
SourceFiles
MeshObject.C
@ -37,21 +64,24 @@ SourceFiles
#define MeshObject_H
#include "regIOobject.H"
#include "objectRegistry.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// Forward declarations
class mapPolyMesh;
/*---------------------------------------------------------------------------*\
Class MeshObject Declaration
Class MeshObject Declaration
\*---------------------------------------------------------------------------*/
template<class Mesh, class Type>
template<class Mesh, template<class> class MeshObjectType, class Type>
class MeshObject
:
public regIOobject
public MeshObjectType<Mesh>
{
protected:
@ -124,6 +154,113 @@ public:
};
/*---------------------------------------------------------------------------*\
Class meshObject Declaration
\*---------------------------------------------------------------------------*/
class meshObject
:
public regIOobject
{
public:
// Declare name of the class and its debug switch
ClassName("meshObject");
// Constructors
meshObject(const word& typeName, const objectRegistry& obr);
// Static member functions
template<class Mesh>
static void movePoints(objectRegistry&);
template<class Mesh>
static void updateMesh(objectRegistry&, const mapPolyMesh&);
template<class Mesh, template<class> class MeshObjectType>
static void clear(objectRegistry&);
};
/*---------------------------------------------------------------------------*\
Class TopologicalMeshObject Declaration
\*---------------------------------------------------------------------------*/
template<class Mesh>
class TopologicalMeshObject
:
public meshObject
{
public:
TopologicalMeshObject(const word& typeName, const objectRegistry& obr)
:
meshObject(typeName, obr)
{}
};
/*---------------------------------------------------------------------------*\
Class GeometricMeshObject Declaration
\*---------------------------------------------------------------------------*/
template<class Mesh>
class GeometricMeshObject
:
public TopologicalMeshObject<Mesh>
{
public:
GeometricMeshObject(const word& typeName, const objectRegistry& obr)
:
TopologicalMeshObject<Mesh>(typeName, obr)
{}
};
/*---------------------------------------------------------------------------*\
Class MoveableMeshObject Declaration
\*---------------------------------------------------------------------------*/
template<class Mesh>
class MoveableMeshObject
:
public GeometricMeshObject<Mesh>
{
public:
MoveableMeshObject(const word& typeName, const objectRegistry& obr)
:
GeometricMeshObject<Mesh>(typeName, obr)
{}
virtual bool movePoints() = 0;
};
/*---------------------------------------------------------------------------*\
Class UpdateableMeshObject Declaration
\*---------------------------------------------------------------------------*/
template<class Mesh>
class UpdateableMeshObject
:
public MoveableMeshObject<Mesh>
{
public:
UpdateableMeshObject(const word& typeName, const objectRegistry& obr)
:
MoveableMeshObject<Mesh>(typeName, obr)
{}
virtual void updateMesh(const mapPolyMesh& mpm) = 0;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam

View File

@ -0,0 +1,52 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 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 "MeshObject.H"
/* * * * * * * * * * * * * * * Static Member Data * * * * * * * * * * * * * */
namespace Foam
{
defineTypeNameAndDebug(meshObject, 0);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::meshObject::meshObject(const word& typeName, const objectRegistry& obr)
:
regIOobject
(
IOobject
(
typeName,
obr.instance(),
obr
)
)
{}
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -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
@ -72,7 +72,7 @@ void Foam::pointMesh::mapFields(const mapPolyMesh& mpm)
Foam::pointMesh::pointMesh(const polyMesh& pMesh)
:
MeshObject<polyMesh, pointMesh>(pMesh),
MeshObject<polyMesh, Foam::UpdateableMeshObject, pointMesh>(pMesh),
GeoMesh<polyMesh>(pMesh),
boundary_(*this, pMesh.boundaryMesh())
{
@ -88,7 +88,7 @@ Foam::pointMesh::pointMesh(const polyMesh& pMesh)
}
void Foam::pointMesh::movePoints(const pointField& newPoints)
bool Foam::pointMesh::movePoints()
{
if (debug)
{
@ -96,7 +96,9 @@ void Foam::pointMesh::movePoints(const pointField& newPoints)
<< "Moving points." << endl;
}
boundary_.movePoints(newPoints);
boundary_.movePoints(GeoMesh<polyMesh>::mesh_.points());
return true;
}

View File

@ -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
@ -48,7 +48,7 @@ namespace Foam
class pointMesh
:
public MeshObject<polyMesh, pointMesh>,
public MeshObject<polyMesh, UpdateableMeshObject, pointMesh>,
public GeoMesh<polyMesh>
{
// Permanent data
@ -121,7 +121,7 @@ public:
// Mesh motion
//- Move points, returns volumes swept by faces in motion
void movePoints(const pointField&);
bool movePoints();
//- Update the mesh corresponding to given map
void updateMesh(const mapPolyMesh& mpm);

View File

@ -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
@ -112,7 +112,7 @@ class globalMeshData
// Private class
// To combineReduce a pointField. Just appends all lists.
template <class T>
template<class T>
class plusEqOp
{

View File

@ -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
@ -26,30 +26,24 @@ License
#include "polyMesh.H"
#include "Time.H"
#include "cellIOList.H"
#include "SubList.H"
#include "wedgePolyPatch.H"
#include "emptyPolyPatch.H"
#include "globalMeshData.H"
#include "processorPolyPatch.H"
#include "OSspecific.H"
#include "polyMeshTetDecomposition.H"
#include "indexedOctree.H"
#include "treeDataCell.H"
#include "SubField.H"
#include "MeshObject.H"
#include "pointMesh.H"
#include "Istream.H"
#include "Ostream.H"
#include "simpleRegIOobject.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(polyMesh, 0);
defineTypeNameAndDebug(polyMesh, 0);
word polyMesh::defaultRegion = "region0";
word polyMesh::meshSubDir = "polyMesh";
word polyMesh::defaultRegion = "region0";
word polyMesh::meshSubDir = "polyMesh";
}
@ -1162,21 +1156,7 @@ Foam::tmp<Foam::scalarField> Foam::polyMesh::movePoints
geometricD_ = Vector<label>::zero;
solutionD_ = Vector<label>::zero;
// Hack until proper callbacks. Below are all the polyMeh MeshObjects with a
// movePoints function.
// pointMesh
if (thisDb().foundObject<pointMesh>(pointMesh::typeName))
{
const_cast<pointMesh&>
(
thisDb().lookupObject<pointMesh>
(
pointMesh::typeName
)
).movePoints(points_);
}
meshObject::movePoints<polyMesh>(*this);
const_cast<Time&>(time()).functionObjects().movePoints(*this);

View File

@ -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
@ -576,9 +576,6 @@ public:
// Geometric checks. Selectively override primitiveMesh functionality.
//- Check boundary for closedness
virtual bool checkClosedBoundary(const bool report = false) const;
//- Check non-orthogonality
virtual bool checkFaceOrthogonality
(

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -434,22 +434,6 @@ bool Foam::polyMesh::checkCellDeterminant
<< "checking for under-determined cells" << endl;
}
// Determine number of dimensions and (for 2D) missing dimension
label nDims = 0;
label twoD = -1;
for (direction dir = 0; dir < vector::nComponents; dir++)
{
if (meshD[dir] == 1)
{
nDims++;
}
else
{
twoD = dir;
}
}
tmp<scalarField> tcellDeterminant = primitiveMeshTools::cellDeterminant
(
*this,
@ -516,15 +500,17 @@ bool Foam::polyMesh::checkCellDeterminant
}
bool Foam::polyMesh::checkClosedBoundary(const bool report) const
{
return primitiveMesh::checkClosedBoundary
(
faceAreas(),
report,
syncTools::getInternalOrCoupledFaces(*this)
);
}
//- Could override checkClosedBoundary to not look at (collocated!) coupled
// faces
//bool Foam::polyMesh::checkClosedBoundary(const bool report) const
//{
// return primitiveMesh::checkClosedBoundary
// (
// faceAreas(),
// report,
// syncTools::getInternalOrCollocatedCoupledFaces(*this)
// );
//}
bool Foam::polyMesh::checkFaceOrthogonality

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -60,7 +60,7 @@ Foam::tmp<Foam::scalarField> Foam::polyMeshTools::faceOrthogonality
// Coupled faces
pointField neighbourCc;
syncTools::swapBoundaryCellList(mesh, cc, neighbourCc);
syncTools::swapBoundaryCellPositions(mesh, cc, neighbourCc);
forAll(pbm, patchI)
{
@ -123,7 +123,7 @@ Foam::tmp<Foam::scalarField> Foam::polyMeshTools::faceSkewness
// (i.e. treat as if mirror cell on other side)
pointField neighbourCc;
syncTools::swapBoundaryCellList(mesh, cellCtrs, neighbourCc);
syncTools::swapBoundaryCellPositions(mesh, cellCtrs, neighbourCc);
forAll(pbm, patchI)
{

View File

@ -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
@ -26,8 +26,7 @@ License
#include "polyMesh.H"
#include "primitiveMesh.H"
#include "globalMeshData.H"
#include "pointMesh.H"
#include "Time.H"
#include "MeshObject.H"
#include "indexedOctree.H"
#include "treeDataCell.H"
@ -61,6 +60,8 @@ void Foam::polyMesh::clearGeom()
<< endl;
}
meshObject::clear<polyMesh, GeometricMeshObject>(*this);
primitiveMesh::clearGeom();
boundary_.clearGeom();
@ -101,6 +102,8 @@ void Foam::polyMesh::clearAddressing()
<< endl;
}
meshObject::clear<polyMesh, TopologicalMeshObject>(*this);
primitiveMesh::clearAddressing();
// parallelData depends on the processorPatch ordering so force
@ -118,6 +121,7 @@ void Foam::polyMesh::clearAddressing()
// Remove the stored tet base points
tetBasePtIsPtr_.clear();
// Remove the cell tree
cellTreePtr_.clear();
}
@ -132,8 +136,6 @@ void Foam::polyMesh::clearPrimitives()
owner_.setSize(0);
neighbour_.setSize(0);
pointMesh::Delete(*this);
clearedPrimitives_ = true;
}
@ -142,8 +144,6 @@ void Foam::polyMesh::clearOut()
{
clearGeom();
clearAddressing();
pointMesh::Delete(*this);
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -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
@ -91,25 +91,12 @@ void Foam::polyMesh::updateMesh(const mapPolyMesh& mpm)
}
}
meshObject::updateMesh<polyMesh>(*this, mpm);
// Reset valid directions (could change by faces put into empty patches)
geometricD_ = Vector<label>::zero;
solutionD_ = Vector<label>::zero;
// Hack until proper callbacks. Below are all the polyMesh-MeshObjects.
// pointMesh
if (thisDb().foundObject<pointMesh>(pointMesh::typeName))
{
const_cast<pointMesh&>
(
thisDb().lookupObject<pointMesh>
(
pointMesh::typeName
)
).updateMesh(mpm);
}
const_cast<Time&>(time()).functionObjects().updateMesh(mpm);
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -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
@ -37,10 +37,7 @@ namespace Foam
}
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::processorCyclicPolyPatch::processorCyclicPolyPatch
(
@ -66,20 +63,10 @@ Foam::processorCyclicPolyPatch::processorCyclicPolyPatch
neighbProcNo,
transform
),
tag_
(
Pstream::nProcs()*max(myProcNo, neighbProcNo)
+ min(myProcNo, neighbProcNo)
),
referPatchName_(referPatchName),
tag_(-1),
referPatchID_(-1)
{
if (debug)
{
Pout<< "processorCyclicPolyPatch " << name << " uses tag " << tag_
<< endl;
}
}
{}
Foam::processorCyclicPolyPatch::processorCyclicPolyPatch
@ -92,20 +79,10 @@ Foam::processorCyclicPolyPatch::processorCyclicPolyPatch
)
:
processorPolyPatch(name, dict, index, bm, patchType),
tag_
(
Pstream::nProcs()*max(myProcNo(), neighbProcNo())
+ min(myProcNo(), neighbProcNo())
),
referPatchName_(dict.lookup("referPatch")),
tag_(dict.lookupOrDefault<int>("tag", -1)),
referPatchID_(-1)
{
if (debug)
{
Pout<< "processorCyclicPolyPatch " << name << " uses tag " << tag_
<< endl;
}
}
{}
Foam::processorCyclicPolyPatch::processorCyclicPolyPatch
@ -115,8 +92,8 @@ Foam::processorCyclicPolyPatch::processorCyclicPolyPatch
)
:
processorPolyPatch(pp, bm),
tag_(pp.tag_),
referPatchName_(pp.referPatchName()),
tag_(pp.tag()),
referPatchID_(-1)
{}
@ -132,8 +109,8 @@ Foam::processorCyclicPolyPatch::processorCyclicPolyPatch
)
:
processorPolyPatch(pp, bm, index, newSize, newStart),
tag_(pp.tag_),
referPatchName_(referPatchName),
tag_(-1),
referPatchID_(-1)
{}
@ -148,8 +125,8 @@ Foam::processorCyclicPolyPatch::processorCyclicPolyPatch
)
:
processorPolyPatch(pp, bm, index, mapAddressing, newStart),
tag_(pp.tag_),
referPatchName_(pp.referPatchName()),
tag_(-1),
referPatchID_(-1)
{}
@ -162,6 +139,45 @@ Foam::processorCyclicPolyPatch::~processorCyclicPolyPatch()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
int Foam::processorCyclicPolyPatch::tag() const
{
if (tag_ == -1)
{
// Get unique tag to use for all comms. Make sure that both sides
// use the same tag
const cyclicPolyPatch& cycPatch = refCast<const cyclicPolyPatch>
(
referPatch()
);
if (owner())
{
tag_ = Hash<word>()(cycPatch.name()) % 32768u;
}
else
{
tag_ = Hash<word>()(cycPatch.neighbPatch().name()) % 32768u;
}
if (tag_ == Pstream::msgType() || tag_ == -1)
{
FatalErrorIn("processorCyclicPolyPatch::tag() const")
<< "Tag calculated from cyclic patch name " << tag_
<< " is the same as the current message type "
<< Pstream::msgType() << " or -1" << nl
<< "Please set a non-conflicting, unique, tag by hand"
<< " using the 'tag' entry"
<< exit(FatalError);
}
if (debug)
{
Pout<< "processorCyclicPolyPatch " << name() << " uses tag " << tag_
<< endl;
}
}
return tag_;
}
void Foam::processorCyclicPolyPatch::initGeometry(PstreamBuffers& pBufs)
{
@ -283,6 +299,11 @@ void Foam::processorCyclicPolyPatch::write(Ostream& os) const
processorPolyPatch::write(os);
os.writeKeyword("referPatch") << referPatchName_
<< token::END_STATEMENT << nl;
if (tag_ != -1)
{
os.writeKeyword("tag") << tag_
<< token::END_STATEMENT << nl;
}
}

View File

@ -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
@ -54,12 +54,12 @@ class processorCyclicPolyPatch
{
// Private data
//- Message tag to use for communication
const int tag_;
//- Name of originating patch
const word referPatchName_;
//- Message tag to use for communication
mutable int tag_;
//- Index of originating patch
mutable label referPatchID_;
@ -264,10 +264,7 @@ public:
}
//- Return message tag to use for communication
virtual int tag() const
{
return tag_;
}
virtual int tag() const;
//- Does this side own the patch ?
virtual bool owner() const

View File

@ -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
@ -21,12 +21,50 @@ License
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*----------------------------------------------------------------------------*/
\*---------------------------------------------------------------------------*/
#include "syncTools.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void Foam::syncTools::swapBoundaryCellPositions
(
const polyMesh& mesh,
const UList<point>& cellData,
List<point>& neighbourCellData
)
{
if (cellData.size() != mesh.nCells())
{
FatalErrorIn
(
"syncTools<class T>::swapBoundaryCellPositions"
"(const polyMesh&, const UList<T>&, List<T>&)"
) << "Number of cell values " << cellData.size()
<< " is not equal to the number of cells in the mesh "
<< mesh.nCells() << abort(FatalError);
}
const polyBoundaryMesh& patches = mesh.boundaryMesh();
label nBnd = mesh.nFaces()-mesh.nInternalFaces();
neighbourCellData.setSize(nBnd);
forAll(patches, patchI)
{
const polyPatch& pp = patches[patchI];
const labelUList& faceCells = pp.faceCells();
forAll(faceCells, i)
{
label bFaceI = pp.start()+i-mesh.nInternalFaces();
neighbourCellData[bFaceI] = cellData[faceCells[i]];
}
}
syncTools::swapBoundaryFacePositions(mesh, neighbourCellData);
}
Foam::PackedBoolList Foam::syncTools::getMasterPoints(const polyMesh& mesh)
{
PackedBoolList isMasterPoint(mesh.nPoints());

View File

@ -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
@ -65,7 +65,7 @@ class syncTools
// Private Member Functions
//- Combine value with existing value in map.
template <class T, class CombineOp>
template<class T, class CombineOp>
static void combine
(
Map<T>& pointValues,
@ -75,7 +75,7 @@ class syncTools
);
//- Combine val with existing value at (implicit index) e.
template <class T, class CombineOp>
template<class T, class CombineOp>
static void combine
(
EdgeMap<T>& edgeValues,
@ -92,7 +92,7 @@ public:
// use specialisations below.
//- Synchronize values on selected points.
template <class T, class CombineOp, class TransformOp>
template<class T, class CombineOp, class TransformOp>
static void syncPointMap
(
const polyMesh&,
@ -102,7 +102,7 @@ public:
);
//- Synchronize values on selected edges.
template <class T, class CombineOp, class TransformOp>
template<class T, class CombineOp, class TransformOp>
static void syncEdgeMap
(
const polyMesh&,
@ -112,7 +112,7 @@ public:
);
//- Synchronize values on all mesh points.
template <class T, class CombineOp, class TransformOp>
template<class T, class CombineOp, class TransformOp>
static void syncPointList
(
const polyMesh&,
@ -123,7 +123,7 @@ public:
);
//- Synchronize values on selected mesh points.
template <class T, class CombineOp, class TransformOp>
template<class T, class CombineOp, class TransformOp>
static void syncPointList
(
const polyMesh&,
@ -135,7 +135,7 @@ public:
);
//- Synchronize values on all mesh edges.
template <class T, class CombineOp, class TransformOp>
template<class T, class CombineOp, class TransformOp>
static void syncEdgeList
(
const polyMesh&,
@ -146,7 +146,7 @@ public:
);
//- Synchronize values on selected mesh edges.
template <class T, class CombineOp, class TransformOp>
template<class T, class CombineOp, class TransformOp>
static void syncEdgeList
(
const polyMesh&,
@ -158,7 +158,7 @@ public:
);
//- Synchronize values on boundary faces only.
template <class T, class CombineOp, class TransformOp>
template<class T, class CombineOp, class TransformOp>
static void syncBoundaryFaceList
(
const polyMesh&,
@ -171,7 +171,7 @@ public:
// Synchronise point-wise data
//- Synchronize values on all mesh points.
template <class T, class CombineOp>
template<class T, class CombineOp>
static void syncPointList
(
const polyMesh& mesh,
@ -191,7 +191,7 @@ public:
}
//- Synchronize locations on all mesh points.
template <class CombineOp>
template<class CombineOp>
static void syncPointPositions
(
const polyMesh& mesh,
@ -211,7 +211,7 @@ public:
}
//- Synchronize values on selected mesh points.
template <class T, class CombineOp>
template<class T, class CombineOp>
static void syncPointList
(
const polyMesh& mesh,
@ -233,7 +233,7 @@ public:
}
//- Synchronize locations on selected mesh points.
template <class CombineOp>
template<class CombineOp>
static void syncPointPositions
(
const polyMesh& mesh,
@ -258,7 +258,7 @@ public:
// Synchronise edge-wise data
//- Synchronize values on all mesh edges.
template <class T, class CombineOp>
template<class T, class CombineOp>
static void syncEdgeList
(
const polyMesh& mesh,
@ -278,7 +278,7 @@ public:
}
//- Synchronize locations on all mesh edges.
template <class CombineOp>
template<class CombineOp>
static void syncEdgePositions
(
const polyMesh& mesh,
@ -298,7 +298,7 @@ public:
}
//- Synchronize values on selected mesh edges.
template <class T, class CombineOp>
template<class T, class CombineOp>
static void syncEdgeList
(
const polyMesh& mesh,
@ -320,7 +320,7 @@ public:
}
//- Synchronize locations on selected mesh edges.
template <class CombineOp>
template<class CombineOp>
static void syncEdgePositions
(
const polyMesh& mesh,
@ -346,7 +346,7 @@ public:
// Synchronise face-wise data
//- Synchronize values on boundary faces only.
template <class T, class CombineOp>
template<class T, class CombineOp>
static void syncBoundaryFaceList
(
const polyMesh& mesh,
@ -358,7 +358,7 @@ public:
}
//- Synchronize locations on boundary faces only.
template <class CombineOp>
template<class CombineOp>
static void syncBoundaryFacePositions
(
const polyMesh& mesh,
@ -376,7 +376,7 @@ public:
}
//- Synchronize values on all mesh faces.
template <class T, class CombineOp>
template<class T, class CombineOp>
static void syncFaceList
(
const polyMesh& mesh,
@ -401,7 +401,7 @@ public:
}
//- Synchronize locations on all mesh faces.
template <class CombineOp>
template<class CombineOp>
static void syncFacePositions
(
const polyMesh& mesh,
@ -425,7 +425,7 @@ public:
}
//- Swap coupled boundary face values.
template <class T>
template<class T>
static void swapBoundaryFaceList
(
const polyMesh& mesh,
@ -442,24 +442,23 @@ public:
}
//- Swap coupled positions.
template <class T>
static void swapBoundaryFacePositions
(
const polyMesh& mesh,
UList<T>& l
UList<point>& l
)
{
syncBoundaryFaceList
(
mesh,
l,
eqOp<T>(),
eqOp<point>(),
mapDistribute::transformPosition()
);
}
//- Swap coupled face values.
template <class T>
template<class T>
static void swapFaceList
(
const polyMesh& mesh,
@ -482,7 +481,7 @@ public:
}
//- Swap to obtain neighbour cell values for all boundary faces
template <class T>
template<class T>
static void swapBoundaryCellList
(
const polyMesh& mesh,
@ -490,10 +489,18 @@ public:
List<T>& neighbourCellData
);
//- Swap to obtain neighbour cell positions for all boundary faces
static void swapBoundaryCellPositions
(
const polyMesh& mesh,
const UList<point>& cellData,
List<point>& neighbourCellData
);
// Sparse versions
//- Synchronize values on selected points.
template <class T, class CombineOp>
template<class T, class CombineOp>
static void syncPointMap
(
const polyMesh& mesh,
@ -505,7 +512,7 @@ public:
}
//- Synchronize locations on selected points.
template <class CombineOp>
template<class CombineOp>
static void syncPointPositions
(
const polyMesh& mesh,
@ -519,7 +526,7 @@ public:
//- Synchronize values on selected edges. Edges are represented
// by the two vertices that make it up so global edges never get
// constructed.
template <class T, class CombineOp>
template<class T, class CombineOp>
static void syncEdgeMap
(
const polyMesh& mesh,
@ -531,11 +538,11 @@ public:
}
//- Synchronize locations on selected edges.
template <class T, class CombineOp>
template<class CombineOp>
static void syncEdgePositions
(
const polyMesh& mesh,
EdgeMap<T>& l,
EdgeMap<point>& l,
const CombineOp& cop
)
{
@ -544,7 +551,7 @@ public:
// PackedList versions
template <unsigned nBits, class CombineOp>
template<unsigned nBits, class CombineOp>
static void syncFaceList
(
const polyMesh& mesh,
@ -552,14 +559,14 @@ public:
const CombineOp& cop
);
template <unsigned nBits>
template<unsigned nBits>
static void swapFaceList
(
const polyMesh& mesh,
PackedList<nBits>& faceValues
);
template <unsigned nBits, class CombineOp>
template<unsigned nBits, class CombineOp>
static void syncPointList
(
const polyMesh& mesh,
@ -568,7 +575,7 @@ public:
const unsigned int nullValue
);
template <unsigned nBits, class CombineOp>
template<unsigned nBits, class CombineOp>
static void syncEdgeList
(
const polyMesh& mesh,

View File

@ -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
@ -21,7 +21,7 @@ License
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*----------------------------------------------------------------------------*/
\*---------------------------------------------------------------------------*/
#include "syncTools.H"
#include "polyMesh.H"
@ -36,7 +36,7 @@ License
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
// Combine val with existing value at index
template <class T, class CombineOp>
template<class T, class CombineOp>
void Foam::syncTools::combine
(
Map<T>& pointValues,
@ -59,7 +59,7 @@ void Foam::syncTools::combine
// Combine val with existing value at (implicit index) e.
template <class T, class CombineOp>
template<class T, class CombineOp>
void Foam::syncTools::combine
(
EdgeMap<T>& edgeValues,
@ -81,7 +81,7 @@ void Foam::syncTools::combine
}
template <class T, class CombineOp, class TransformOp>
template<class T, class CombineOp, class TransformOp>
void Foam::syncTools::syncPointMap
(
const polyMesh& mesh,
@ -386,7 +386,7 @@ void Foam::syncTools::syncPointMap
}
template <class T, class CombineOp, class TransformOp>
template<class T, class CombineOp, class TransformOp>
void Foam::syncTools::syncEdgeMap
(
const polyMesh& mesh,
@ -761,7 +761,7 @@ void Foam::syncTools::syncEdgeMap
}
//template <class T, class CombineOp, class TransformOp>
//template<class T, class CombineOp, class TransformOp>
//void Foam::syncTools::syncPointList
//(
// const polyMesh& mesh,
@ -937,7 +937,7 @@ void Foam::syncTools::syncEdgeMap
//}
//template <class T, class CombineOp, class TransformOp>
//template<class T, class CombineOp, class TransformOp>
//void Foam::syncTools::syncPointList
//(
// const polyMesh& mesh,
@ -987,7 +987,7 @@ void Foam::syncTools::syncEdgeMap
// }
//}
template <class T, class CombineOp, class TransformOp>
template<class T, class CombineOp, class TransformOp>
void Foam::syncTools::syncPointList
(
const polyMesh& mesh,
@ -1013,7 +1013,7 @@ void Foam::syncTools::syncPointList
}
//template <class CombineOp>
//template<class CombineOp>
//void Foam::syncTools::syncPointPositions
//(
// const polyMesh& mesh,
@ -1037,7 +1037,7 @@ void Foam::syncTools::syncPointList
//}
template <class T, class CombineOp, class TransformOp>
template<class T, class CombineOp, class TransformOp>
void Foam::syncTools::syncPointList
(
const polyMesh& mesh,
@ -1097,7 +1097,7 @@ void Foam::syncTools::syncPointList
}
//template <class CombineOp>
//template<class CombineOp>
//void Foam::syncTools::syncPointPositions
//(
// const polyMesh& mesh,
@ -1157,7 +1157,7 @@ void Foam::syncTools::syncPointList
//}
template <class T, class CombineOp, class TransformOp>
template<class T, class CombineOp, class TransformOp>
void Foam::syncTools::syncEdgeList
(
const polyMesh& mesh,
@ -1204,7 +1204,7 @@ void Foam::syncTools::syncEdgeList
}
//template <class CombineOp>
//template<class CombineOp>
//void Foam::syncTools::syncEdgePositions
//(
// const polyMesh& mesh,
@ -1251,7 +1251,7 @@ void Foam::syncTools::syncEdgeList
//}
template <class T, class CombineOp, class TransformOp>
template<class T, class CombineOp, class TransformOp>
void Foam::syncTools::syncEdgeList
(
const polyMesh& mesh,
@ -1310,7 +1310,7 @@ void Foam::syncTools::syncEdgeList
}
}
template <class T, class CombineOp, class TransformOp>
template<class T, class CombineOp, class TransformOp>
void Foam::syncTools::syncBoundaryFaceList
(
const polyMesh& mesh,
@ -1436,7 +1436,7 @@ void Foam::syncTools::syncBoundaryFaceList
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template <unsigned nBits, class CombineOp>
template<unsigned nBits, class CombineOp>
void Foam::syncTools::syncFaceList
(
const polyMesh& mesh,
@ -1553,7 +1553,7 @@ void Foam::syncTools::syncFaceList
}
template <class T>
template<class T>
void Foam::syncTools::swapBoundaryCellList
(
const polyMesh& mesh,
@ -1592,7 +1592,7 @@ void Foam::syncTools::swapBoundaryCellList
}
template <unsigned nBits>
template<unsigned nBits>
void Foam::syncTools::swapFaceList
(
const polyMesh& mesh,
@ -1603,7 +1603,7 @@ void Foam::syncTools::swapFaceList
}
template <unsigned nBits, class CombineOp>
template<unsigned nBits, class CombineOp>
void Foam::syncTools::syncPointList
(
const polyMesh& mesh,
@ -1650,7 +1650,7 @@ void Foam::syncTools::syncPointList
}
template <unsigned nBits, class CombineOp>
template<unsigned nBits, class CombineOp>
void Foam::syncTools::syncEdgeList
(
const polyMesh& mesh,

View File

@ -270,8 +270,8 @@ public:
);
//- Gather points and faces onto master and merge (geometrically) into
// single patch.
//- Gather points and faces onto master and merge into single patch.
// Note: uses faces/points, not localFaces/localPoints.
template
<
class Face,

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -52,7 +52,8 @@ void Foam::PatchTools::gatherAndMerge
labelList pointSizes;
{
List<Field<PointType> > gatheredPoints(Pstream::nProcs());
gatheredPoints[Pstream::myProcNo()] = p.localPoints();
gatheredPoints[Pstream::myProcNo()] = p.points();
Pstream::gatherList(gatheredPoints);
if (Pstream::master())
@ -75,7 +76,7 @@ void Foam::PatchTools::gatherAndMerge
// gathered points
{
List<List<Face> > gatheredFaces(Pstream::nProcs());
gatheredFaces[Pstream::myProcNo()] = p.localFaces();
gatheredFaces[Pstream::myProcNo()] = p;
Pstream::gatherList(gatheredFaces);
if (Pstream::master())

View File

@ -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
@ -394,7 +394,7 @@ public:
// Other patch operations
//- Project vertices of patch onto another patch
template <class ToPatch>
template<class ToPatch>
List<objectHit> projectPoints
(
const ToPatch& targetPatch,
@ -404,7 +404,7 @@ public:
) const;
//- Project vertices of patch onto another patch
template <class ToPatch>
template<class ToPatch>
List<objectHit> projectFaceCentres
(
const ToPatch& targetPatch,

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-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -41,7 +41,7 @@ template
class PointField,
class PointType
>
template <class ToPatch>
template<class ToPatch>
Foam::List<Foam::objectHit>
Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
projectPoints
@ -288,7 +288,7 @@ template
class PointField,
class PointType
>
template <class ToPatch>
template<class ToPatch>
Foam::List<Foam::objectHit>
Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
projectFaceCentres

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -64,7 +64,7 @@ bool Foam::primitiveMesh::checkClosedBoundary
for (label faceI = nInternalFaces(); faceI < areas.size(); faceI++)
{
if (internalOrCoupledFaces.size() && !internalOrCoupledFaces[faceI])
if (!internalOrCoupledFaces.size() || !internalOrCoupledFaces[faceI])
{
sumClosed += areas[faceI];
sumMagClosedBoundary += mag(areas[faceI]);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

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-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -50,7 +50,7 @@ namespace Foam
Class DiagTensor Declaration
\*---------------------------------------------------------------------------*/
template <class Cmpt>
template<class Cmpt>
class DiagTensor
:
public VectorSpace<DiagTensor<Cmpt>, Cmpt, 3>
@ -86,7 +86,8 @@ public:
inline DiagTensor();
//- Construct given VectorSpace
inline DiagTensor(const VectorSpace<DiagTensor<Cmpt>, Cmpt, 3>&);
template<class Cmpt2>
inline DiagTensor(const VectorSpace<DiagTensor<Cmpt2>, Cmpt2, 3>&);
//- Construct given three components
inline DiagTensor(const Cmpt& txx, const Cmpt& tyy, const Cmpt& tzz);

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-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -32,25 +32,23 @@ namespace Foam
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Construct null
template <class Cmpt>
template<class Cmpt>
inline DiagTensor<Cmpt>::DiagTensor()
{}
// Construct given VectorSpace
template <class Cmpt>
template<class Cmpt>
template<class Cmpt2>
inline DiagTensor<Cmpt>::DiagTensor
(
const VectorSpace<DiagTensor<Cmpt>, Cmpt, 3>& vs
const VectorSpace<DiagTensor<Cmpt2>, Cmpt2, 3>& vs
)
:
VectorSpace<DiagTensor<Cmpt>, Cmpt, 3>(vs)
{}
// Construct given three Cmpts
template <class Cmpt>
template<class Cmpt>
inline DiagTensor<Cmpt>::DiagTensor
(
const Cmpt& vxx,
@ -64,8 +62,7 @@ inline DiagTensor<Cmpt>::DiagTensor
}
// Construct from Istream
template <class Cmpt>
template<class Cmpt>
inline DiagTensor<Cmpt>::DiagTensor(Istream& is)
:
VectorSpace<DiagTensor<Cmpt>, Cmpt, 3>(is)
@ -74,38 +71,38 @@ inline DiagTensor<Cmpt>::DiagTensor(Istream& is)
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template <class Cmpt>
template<class Cmpt>
inline const Cmpt& DiagTensor<Cmpt>::xx() const
{
return this->v_[XX];
}
template <class Cmpt>
template<class Cmpt>
inline const Cmpt& DiagTensor<Cmpt>::yy() const
{
return this->v_[YY];
}
template <class Cmpt>
template<class Cmpt>
inline const Cmpt& DiagTensor<Cmpt>::zz() const
{
return this->v_[ZZ];
}
template <class Cmpt>
template<class Cmpt>
inline Cmpt& DiagTensor<Cmpt>::xx()
{
return this->v_[XX];
}
template <class Cmpt>
template<class Cmpt>
inline Cmpt& DiagTensor<Cmpt>::yy()
{
return this->v_[YY];
}
template <class Cmpt>
template<class Cmpt>
inline Cmpt& DiagTensor<Cmpt>::zz()
{
return this->v_[ZZ];
@ -114,7 +111,7 @@ inline Cmpt& DiagTensor<Cmpt>::zz()
// * * * * * * * * * * * * * * * Global Operators * * * * * * * * * * * * * //
template <class Cmpt>
template<class Cmpt>
inline Tensor<Cmpt>
operator+(const DiagTensor<Cmpt>& dt1, const Tensor<Cmpt>& t2)
{
@ -127,7 +124,7 @@ operator+(const DiagTensor<Cmpt>& dt1, const Tensor<Cmpt>& t2)
}
template <class Cmpt>
template<class Cmpt>
inline Tensor<Cmpt>
operator+(const Tensor<Cmpt>& t1, const DiagTensor<Cmpt>& dt2)
{
@ -140,7 +137,7 @@ operator+(const Tensor<Cmpt>& t1, const DiagTensor<Cmpt>& dt2)
}
template <class Cmpt>
template<class Cmpt>
inline Tensor<Cmpt>
operator-(const DiagTensor<Cmpt>& dt1, const Tensor<Cmpt>& t2)
{
@ -153,7 +150,7 @@ operator-(const DiagTensor<Cmpt>& dt1, const Tensor<Cmpt>& t2)
}
template <class Cmpt>
template<class Cmpt>
inline Tensor<Cmpt>
operator-(const Tensor<Cmpt>& t1, const DiagTensor<Cmpt>& dt2)
{
@ -167,7 +164,7 @@ operator-(const Tensor<Cmpt>& t1, const DiagTensor<Cmpt>& dt2)
//- Inner-product between two diagonal tensors
template <class Cmpt>
template<class Cmpt>
inline DiagTensor<Cmpt>
operator&(const DiagTensor<Cmpt>& dt1, const DiagTensor<Cmpt>& dt2)
{
@ -181,7 +178,7 @@ operator&(const DiagTensor<Cmpt>& dt1, const DiagTensor<Cmpt>& dt2)
//- Inner-product between a diagonal tensor and a tensor
template <class Cmpt>
template<class Cmpt>
inline Tensor<Cmpt>
operator&(const DiagTensor<Cmpt>& dt1, const Tensor<Cmpt>& t2)
{
@ -203,7 +200,7 @@ operator&(const DiagTensor<Cmpt>& dt1, const Tensor<Cmpt>& t2)
//- Inner-product between a tensor and a diagonal tensor
template <class Cmpt>
template<class Cmpt>
inline Tensor<Cmpt>
operator&(const Tensor<Cmpt>& t1, const DiagTensor<Cmpt>& dt2)
{
@ -225,7 +222,7 @@ operator&(const Tensor<Cmpt>& t1, const DiagTensor<Cmpt>& dt2)
//- Inner-product between a diagonal tensor and a vector
template <class Cmpt>
template<class Cmpt>
inline Vector<Cmpt>
operator&(const DiagTensor<Cmpt>& dt, const Vector<Cmpt>& v)
{
@ -239,7 +236,7 @@ operator&(const DiagTensor<Cmpt>& dt, const Vector<Cmpt>& v)
//- Inner-product between a vector and a diagonal tensor
template <class Cmpt>
template<class Cmpt>
inline Vector<Cmpt>
operator&(const Vector<Cmpt>& v, const DiagTensor<Cmpt>& dt)
{
@ -253,7 +250,7 @@ operator&(const Vector<Cmpt>& v, const DiagTensor<Cmpt>& dt)
//- Division of a scalar by a diagonalTensor
template <class Cmpt>
template<class Cmpt>
inline DiagTensor<Cmpt>
operator/(const scalar s, const DiagTensor<Cmpt>& dt)
{
@ -262,7 +259,7 @@ operator/(const scalar s, const DiagTensor<Cmpt>& dt)
//- Division of a vector by a diagonalTensor
template <class Cmpt>
template<class Cmpt>
inline Vector<Cmpt>
operator/(const Vector<Cmpt> v, const DiagTensor<Cmpt>& dt)
{
@ -271,7 +268,7 @@ operator/(const Vector<Cmpt> v, const DiagTensor<Cmpt>& dt)
//- Return the trace of a diagonal tensor
template <class Cmpt>
template<class Cmpt>
inline Cmpt tr(const DiagTensor<Cmpt>& dt)
{
return dt.xx() + dt.yy() + dt.zz();
@ -279,7 +276,7 @@ inline Cmpt tr(const DiagTensor<Cmpt>& dt)
//- Return the spherical part of a diagonal tensor
template <class Cmpt>
template<class Cmpt>
inline SphericalTensor<Cmpt> sph(const DiagTensor<Cmpt>& dt)
{
return 0.5*tr(dt);
@ -287,7 +284,7 @@ inline SphericalTensor<Cmpt> sph(const DiagTensor<Cmpt>& dt)
//- Return the determinant of a diagonal tensor
template <class Cmpt>
template<class Cmpt>
inline Cmpt det(const DiagTensor<Cmpt>& t)
{
return t.xx()*t.yy()*t.zz();
@ -295,7 +292,7 @@ inline Cmpt det(const DiagTensor<Cmpt>& t)
//- Return the inverse of a symmetric tensor
template <class Cmpt>
template<class Cmpt>
inline DiagTensor<Cmpt> inv(const DiagTensor<Cmpt>& dt)
{
return DiagTensor<Cmpt>(1.0/dt.xx(), 1.0/dt.yy(), 1.0/dt.zz());
@ -303,7 +300,7 @@ inline DiagTensor<Cmpt> inv(const DiagTensor<Cmpt>& dt)
//- Return the diagonal of a tensor as a diagonal tensor
template <class Cmpt>
template<class Cmpt>
inline DiagTensor<Cmpt> diag(const Tensor<Cmpt>& t)
{
return DiagTensor<Cmpt>(t.xx(), t.yy(), t.zz());

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-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -91,9 +91,10 @@ public:
inline SphericalTensor();
//- Construct given VectorSpace
template<class Cmpt2>
inline SphericalTensor
(
const VectorSpace<SphericalTensor<Cmpt>, Cmpt, 1>&
const VectorSpace<SphericalTensor<Cmpt2>, Cmpt2, 1>&
);
//- Construct given the component

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-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -32,33 +32,30 @@ namespace Foam
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Construct null
template <class Cmpt>
template<class Cmpt>
inline SphericalTensor<Cmpt>::SphericalTensor()
{}
// Construct given VectorSpace
template <class Cmpt>
template<class Cmpt>
template<class Cmpt2>
inline SphericalTensor<Cmpt>::SphericalTensor
(
const VectorSpace<SphericalTensor<Cmpt>, Cmpt, 1>& vs
const VectorSpace<SphericalTensor<Cmpt2>, Cmpt2, 1>& vs
)
:
VectorSpace<SphericalTensor<Cmpt>, Cmpt, 1>(vs)
{}
// Construct given three Cmpts
template <class Cmpt>
template<class Cmpt>
inline SphericalTensor<Cmpt>::SphericalTensor(const Cmpt& stii)
{
this->v_[II] = stii;
}
// Construct from Istream
template <class Cmpt>
template<class Cmpt>
inline SphericalTensor<Cmpt>::SphericalTensor(Istream& is)
:
VectorSpace<SphericalTensor<Cmpt>, Cmpt, 1>(is)
@ -67,21 +64,21 @@ inline SphericalTensor<Cmpt>::SphericalTensor(Istream& is)
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template <class Cmpt>
template<class Cmpt>
inline const Cmpt& SphericalTensor<Cmpt>::ii() const
{
return this->v_[II];
}
template <class Cmpt>
template<class Cmpt>
inline Cmpt& SphericalTensor<Cmpt>::ii()
{
return this->v_[II];
}
template <class Cmpt>
template<class Cmpt>
inline const SphericalTensor<Cmpt>& SphericalTensor<Cmpt>::T() const
{
return *this;
@ -91,7 +88,7 @@ inline const SphericalTensor<Cmpt>& SphericalTensor<Cmpt>::T() const
// * * * * * * * * * * * * * * * Global Operators * * * * * * * * * * * * * //
//- Inner-product between two spherical tensors
template <class Cmpt>
template<class Cmpt>
inline SphericalTensor<Cmpt>
operator&(const SphericalTensor<Cmpt>& st1, const SphericalTensor<Cmpt>& st2)
{
@ -100,7 +97,7 @@ operator&(const SphericalTensor<Cmpt>& st1, const SphericalTensor<Cmpt>& st2)
//- Inner-product between a spherical tensor and a vector
template <class Cmpt>
template<class Cmpt>
inline Vector<Cmpt>
operator&(const SphericalTensor<Cmpt>& st, const Vector<Cmpt>& v)
{
@ -114,7 +111,7 @@ operator&(const SphericalTensor<Cmpt>& st, const Vector<Cmpt>& v)
//- Inner-product between a vector and a spherical tensor
template <class Cmpt>
template<class Cmpt>
inline Vector<Cmpt>
operator&(const Vector<Cmpt>& v, const SphericalTensor<Cmpt>& st)
{
@ -128,7 +125,7 @@ operator&(const Vector<Cmpt>& v, const SphericalTensor<Cmpt>& st)
//- Double-dot-product between a spherical tensor and a spherical tensor
template <class Cmpt>
template<class Cmpt>
inline Cmpt
operator&&(const SphericalTensor<Cmpt>& st1, const SphericalTensor<Cmpt>& st2)
{
@ -137,7 +134,7 @@ operator&&(const SphericalTensor<Cmpt>& st1, const SphericalTensor<Cmpt>& st2)
//- Division of a scalar by a sphericalTensor
template <class Cmpt>
template<class Cmpt>
inline SphericalTensor<Cmpt>
operator/(const scalar s, const SphericalTensor<Cmpt>& st)
{
@ -145,7 +142,7 @@ operator/(const scalar s, const SphericalTensor<Cmpt>& st)
}
template <class Cmpt>
template<class Cmpt>
inline Cmpt magSqr(const SphericalTensor<Cmpt>& st)
{
return 3*magSqr(st.ii());
@ -153,7 +150,7 @@ inline Cmpt magSqr(const SphericalTensor<Cmpt>& st)
//- Return the trace of a spherical tensor
template <class Cmpt>
template<class Cmpt>
inline Cmpt tr(const SphericalTensor<Cmpt>& st)
{
return 3*st.ii();
@ -161,7 +158,7 @@ inline Cmpt tr(const SphericalTensor<Cmpt>& st)
//- Return the spherical part of a spherical tensor, i.e. itself
template <class Cmpt>
template<class Cmpt>
inline SphericalTensor<Cmpt> sph(const SphericalTensor<Cmpt>& st)
{
return st;
@ -169,7 +166,7 @@ inline SphericalTensor<Cmpt> sph(const SphericalTensor<Cmpt>& st)
//- Return the determinant of a spherical tensor
template <class Cmpt>
template<class Cmpt>
inline Cmpt det(const SphericalTensor<Cmpt>& st)
{
return st.ii()*st.ii()*st.ii();
@ -177,7 +174,7 @@ inline Cmpt det(const SphericalTensor<Cmpt>& st)
//- Return the inverse of a spherical tensor
template <class Cmpt>
template<class Cmpt>
inline SphericalTensor<Cmpt> inv(const SphericalTensor<Cmpt>& st)
{
return SphericalTensor<Cmpt>(1.0/st.ii());

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-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -33,13 +33,13 @@ namespace Foam
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Construct null
template <class Cmpt>
template<class Cmpt>
inline SphericalTensor2D<Cmpt>::SphericalTensor2D()
{}
// Construct given VectorSpace
template <class Cmpt>
template<class Cmpt>
inline SphericalTensor2D<Cmpt>::SphericalTensor2D
(
const VectorSpace<SphericalTensor2D<Cmpt>, Cmpt, 1>& vs
@ -50,7 +50,7 @@ inline SphericalTensor2D<Cmpt>::SphericalTensor2D
// Construct given three Cmpts
template <class Cmpt>
template<class Cmpt>
inline SphericalTensor2D<Cmpt>::SphericalTensor2D(const Cmpt& stii)
{
this->v_[II] = stii;
@ -58,7 +58,7 @@ inline SphericalTensor2D<Cmpt>::SphericalTensor2D(const Cmpt& stii)
// Construct from Istream
template <class Cmpt>
template<class Cmpt>
inline SphericalTensor2D<Cmpt>::SphericalTensor2D(Istream& is)
:
VectorSpace<SphericalTensor2D<Cmpt>, Cmpt, 1>(is)
@ -67,14 +67,14 @@ inline SphericalTensor2D<Cmpt>::SphericalTensor2D(Istream& is)
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template <class Cmpt>
template<class Cmpt>
inline const Cmpt& SphericalTensor2D<Cmpt>::ii() const
{
return this->v_[II];
}
template <class Cmpt>
template<class Cmpt>
inline Cmpt& SphericalTensor2D<Cmpt>::ii()
{
return this->v_[II];
@ -84,7 +84,7 @@ inline Cmpt& SphericalTensor2D<Cmpt>::ii()
// * * * * * * * * * * * * * * * Global Operators * * * * * * * * * * * * * //
//- Inner-product between two spherical tensors
template <class Cmpt>
template<class Cmpt>
inline SphericalTensor2D<Cmpt>
operator&
(
@ -97,7 +97,7 @@ operator&
//- Inner-product between a spherical tensor and a vector
template <class Cmpt>
template<class Cmpt>
inline Vector2D<Cmpt>
operator&(const SphericalTensor2D<Cmpt>& st, const Vector2D<Cmpt>& v)
{
@ -110,7 +110,7 @@ operator&(const SphericalTensor2D<Cmpt>& st, const Vector2D<Cmpt>& v)
//- Inner-product between a vector and a spherical tensor
template <class Cmpt>
template<class Cmpt>
inline Vector2D<Cmpt>
operator&(const Vector2D<Cmpt>& v, const SphericalTensor2D<Cmpt>& st)
{
@ -123,7 +123,7 @@ operator&(const Vector2D<Cmpt>& v, const SphericalTensor2D<Cmpt>& st)
//- Division of a scalar by a sphericalTensor2D
template <class Cmpt>
template<class Cmpt>
inline SphericalTensor2D<Cmpt>
operator/(const scalar s, const SphericalTensor2D<Cmpt>& st)
{
@ -132,7 +132,7 @@ operator/(const scalar s, const SphericalTensor2D<Cmpt>& st)
//- Return the trace of a spherical tensor
template <class Cmpt>
template<class Cmpt>
inline Cmpt tr(const SphericalTensor2D<Cmpt>& st)
{
return 2*st.ii();
@ -140,7 +140,7 @@ inline Cmpt tr(const SphericalTensor2D<Cmpt>& st)
//- Return the spherical part of a spherical tensor, i.e. itself
template <class Cmpt>
template<class Cmpt>
inline SphericalTensor2D<Cmpt> sph(const SphericalTensor2D<Cmpt>& st)
{
return st;
@ -148,7 +148,7 @@ inline SphericalTensor2D<Cmpt> sph(const SphericalTensor2D<Cmpt>& st)
//- Return the determinant of a spherical tensor
template <class Cmpt>
template<class Cmpt>
inline Cmpt det(const SphericalTensor2D<Cmpt>& st)
{
return st.ii()*st.ii();
@ -156,7 +156,7 @@ inline Cmpt det(const SphericalTensor2D<Cmpt>& st)
//- Return the inverse of a symmetric tensor
template <class Cmpt>
template<class Cmpt>
inline SphericalTensor2D<Cmpt> inv(const SphericalTensor2D<Cmpt>& st)
{
return SphericalTensor2D<Cmpt>(1.0/st.ii());

Some files were not shown because too many files have changed in this diff Show More