mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
GIT: Initial commit after latest foundation merge
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -169,10 +169,10 @@ public:
|
||||
|
||||
//- Sample the cell field
|
||||
template<class Type>
|
||||
tmp<Field<Type> > sample(const Field<Type>&) const;
|
||||
tmp<Field<Type>> sample(const Field<Type>&) const;
|
||||
|
||||
template<class Type>
|
||||
tmp<Field<Type> > sample(const tmp<Field<Type> >&) const;
|
||||
tmp<Field<Type>> sample(const tmp<Field<Type>>&) const;
|
||||
|
||||
|
||||
// Member Operators
|
||||
@ -188,7 +188,7 @@ public:
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
# include "cuttingPlaneTemplates.C"
|
||||
#include "cuttingPlaneTemplates.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -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-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -33,22 +33,22 @@ Description
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
Foam::tmp<Foam::Field<Type> > Foam::cuttingPlane::sample
|
||||
Foam::tmp<Foam::Field<Type>> Foam::cuttingPlane::sample
|
||||
(
|
||||
const Field<Type>& fld
|
||||
) const
|
||||
{
|
||||
return tmp<Field<Type> >(new Field<Type>(fld, cutCells()));
|
||||
return tmp<Field<Type>>(new Field<Type>(fld, cutCells()));
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::tmp<Foam::Field<Type> > Foam::cuttingPlane::sample
|
||||
Foam::tmp<Foam::Field<Type>> Foam::cuttingPlane::sample
|
||||
(
|
||||
const tmp<Field<Type> >& tfld
|
||||
const tmp<Field<Type>>& tfld
|
||||
) const
|
||||
{
|
||||
tmp<Field<Type> > tsf = sample(tfld());
|
||||
tmp<Field<Type>> tsf = sample(tfld());
|
||||
tfld.clear();
|
||||
return tsf;
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -106,11 +106,11 @@ void Foam::cellVolumeWeightMethod::calculateAddressing
|
||||
label srcCellI = srcSeedI;
|
||||
label tgtCellI = tgtSeedI;
|
||||
|
||||
List<DynamicList<label> > srcToTgtAddr(src_.nCells());
|
||||
List<DynamicList<scalar> > srcToTgtWght(src_.nCells());
|
||||
List<DynamicList<label>> srcToTgtAddr(src_.nCells());
|
||||
List<DynamicList<scalar>> srcToTgtWght(src_.nCells());
|
||||
|
||||
List<DynamicList<label> > tgtToSrcAddr(tgt_.nCells());
|
||||
List<DynamicList<scalar> > tgtToSrcWght(tgt_.nCells());
|
||||
List<DynamicList<label>> tgtToSrcAddr(tgt_.nCells());
|
||||
List<DynamicList<scalar>> tgtToSrcWght(tgt_.nCells());
|
||||
|
||||
// list of tgt cell neighbour cells
|
||||
DynamicList<label> nbrTgtCells(10);
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -93,6 +93,11 @@ protected:
|
||||
labelList& seedCells
|
||||
) const;
|
||||
|
||||
|
||||
private:
|
||||
|
||||
// Private member functions
|
||||
|
||||
//- Disallow default bitwise copy construct
|
||||
cellVolumeWeightMethod(const cellVolumeWeightMethod&);
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -110,8 +110,8 @@ void Foam::directMethod::calculateAddressing
|
||||
// store a list of src cells already mapped
|
||||
labelList srcTgtSeed(src_.nCells(), -1);
|
||||
|
||||
List<DynamicList<label> > srcToTgt(src_.nCells());
|
||||
List<DynamicList<label> > tgtToSrc(tgt_.nCells());
|
||||
List<DynamicList<label>> srcToTgt(src_.nCells());
|
||||
List<DynamicList<label>> tgtToSrc(tgt_.nCells());
|
||||
|
||||
DynamicList<label> srcSeeds(10);
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -98,6 +98,11 @@ protected:
|
||||
label& tgtSeedI
|
||||
) const;
|
||||
|
||||
|
||||
private:
|
||||
|
||||
// Private member functions
|
||||
|
||||
//- Disallow default bitwise copy construct
|
||||
directMethod(const directMethod&);
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -102,8 +102,8 @@ void Foam::mapNearestMethod::calculateAddressing
|
||||
label& startSeedI
|
||||
)
|
||||
{
|
||||
List<DynamicList<label> > srcToTgt(src_.nCells());
|
||||
List<DynamicList<label> > tgtToSrc(tgt_.nCells());
|
||||
List<DynamicList<label>> srcToTgt(src_.nCells());
|
||||
List<DynamicList<label>> tgtToSrc(tgt_.nCells());
|
||||
|
||||
const scalarField& srcVc = src_.cellVolumes();
|
||||
const scalarField& tgtVc = tgt_.cellVolumes();
|
||||
@ -284,7 +284,7 @@ void Foam::mapNearestMethod::setNextNearestCells
|
||||
Foam::label Foam::mapNearestMethod::findMappedSrcCell
|
||||
(
|
||||
const label tgtCellI,
|
||||
const List<DynamicList<label> >& tgtToSrc
|
||||
const List<DynamicList<label>>& tgtToSrc
|
||||
) const
|
||||
{
|
||||
DynamicList<label> testCells(10);
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -108,7 +108,7 @@ protected:
|
||||
virtual label findMappedSrcCell
|
||||
(
|
||||
const label tgtCellI,
|
||||
const List<DynamicList<label> >& tgtToSrc
|
||||
const List<DynamicList<label>>& tgtToSrc
|
||||
) const;
|
||||
|
||||
//- Disallow default bitwise copy construct
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
/*---------------------------------------------------------------------------* \
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -109,6 +109,11 @@ protected:
|
||||
scalarListList& tgtToTgtWght
|
||||
) const;
|
||||
|
||||
|
||||
private:
|
||||
|
||||
// Private member functions
|
||||
|
||||
//- Disallow default bitwise copy construct
|
||||
meshToMeshMethod(const meshToMeshMethod&);
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2012-2014 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -581,7 +581,7 @@ void Foam::meshToMesh::calculate(const word& methodName)
|
||||
);
|
||||
|
||||
// cache maps and reset addresses
|
||||
List<Map<label> > cMap;
|
||||
List<Map<label>> cMap;
|
||||
srcMapPtr_.reset
|
||||
(
|
||||
new mapDistribute(globalSrcCells, tgtToSrcCellAddr_, cMap)
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2012-2014 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -416,7 +416,7 @@ public:
|
||||
//- Return the src field mapped to the tgt mesh with a defined
|
||||
// operation. Initial values of the result are set to zero
|
||||
template<class Type, class CombineOp>
|
||||
tmp<Field<Type> > mapSrcToTgt
|
||||
tmp<Field<Type>> mapSrcToTgt
|
||||
(
|
||||
const Field<Type>& srcFld,
|
||||
const CombineOp& cop
|
||||
@ -425,16 +425,16 @@ public:
|
||||
//- Convenience function to map a tmp field to the tgt mesh
|
||||
// with a defined operation
|
||||
template<class Type, class CombineOp>
|
||||
tmp<Field<Type> > mapSrcToTgt
|
||||
tmp<Field<Type>> mapSrcToTgt
|
||||
(
|
||||
const tmp<Field<Type> >& tsrcFld,
|
||||
const tmp<Field<Type>>& tsrcFld,
|
||||
const CombineOp& cop
|
||||
) const;
|
||||
|
||||
//- Convenience function to map a field to the tgt mesh with a
|
||||
// default operation (plusEqOp)
|
||||
template<class Type>
|
||||
tmp<Field<Type> > mapSrcToTgt
|
||||
tmp<Field<Type>> mapSrcToTgt
|
||||
(
|
||||
const Field<Type>& srcFld
|
||||
) const;
|
||||
@ -442,9 +442,9 @@ public:
|
||||
//- Convenience function to map a tmp field to the tgt mesh
|
||||
// with a default operation (plusEqOp)
|
||||
template<class Type>
|
||||
tmp<Field<Type> > mapSrcToTgt
|
||||
tmp<Field<Type>> mapSrcToTgt
|
||||
(
|
||||
const tmp<Field<Type> >& tsrcFld
|
||||
const tmp<Field<Type>>& tsrcFld
|
||||
) const;
|
||||
|
||||
|
||||
@ -479,7 +479,7 @@ public:
|
||||
//- Return the tgt field mapped to the src mesh with a defined
|
||||
// operation. Initial values of the result are set to zero
|
||||
template<class Type, class CombineOp>
|
||||
tmp<Field<Type> > mapTgtToSrc
|
||||
tmp<Field<Type>> mapTgtToSrc
|
||||
(
|
||||
const Field<Type>& tgtFld,
|
||||
const CombineOp& cop
|
||||
@ -488,16 +488,16 @@ public:
|
||||
//- Convenience function to map a tmp field to the src mesh
|
||||
// with a defined operation
|
||||
template<class Type, class CombineOp>
|
||||
tmp<Field<Type> > mapTgtToSrc
|
||||
tmp<Field<Type>> mapTgtToSrc
|
||||
(
|
||||
const tmp<Field<Type> >& ttgtFld,
|
||||
const tmp<Field<Type>>& ttgtFld,
|
||||
const CombineOp& cop
|
||||
) const;
|
||||
|
||||
//- Convenience function to map a field to the src mesh with a
|
||||
// default operation (plusEqOp)
|
||||
template<class Type>
|
||||
tmp<Field<Type> > mapTgtToSrc
|
||||
tmp<Field<Type>> mapTgtToSrc
|
||||
(
|
||||
const Field<Type>& tgtFld
|
||||
) const;
|
||||
@ -505,9 +505,9 @@ public:
|
||||
//- Convenience function to map a tmp field to the src mesh
|
||||
// with a default operation (plusEqOp)
|
||||
template<class Type>
|
||||
tmp<Field<Type> > mapTgtToSrc
|
||||
tmp<Field<Type>> mapTgtToSrc
|
||||
(
|
||||
const tmp<Field<Type> >& ttgtFld
|
||||
const tmp<Field<Type>>& ttgtFld
|
||||
) const;
|
||||
|
||||
|
||||
@ -529,7 +529,7 @@ public:
|
||||
//- Interpolate a field with a defined operation. The initial
|
||||
// values of the result are set to zero
|
||||
template<class Type, class CombineOp>
|
||||
tmp<GeometricField<Type, fvPatchField, volMesh> > mapSrcToTgt
|
||||
tmp<GeometricField<Type, fvPatchField, volMesh>> mapSrcToTgt
|
||||
(
|
||||
const GeometricField<Type, fvPatchField, volMesh>& field,
|
||||
const CombineOp& cop,
|
||||
@ -539,9 +539,9 @@ public:
|
||||
//- Interpolate a tmp field with a defined operation. The
|
||||
// initial values of the result are set to zero
|
||||
template<class Type, class CombineOp>
|
||||
tmp<GeometricField<Type, fvPatchField, volMesh> > mapSrcToTgt
|
||||
tmp<GeometricField<Type, fvPatchField, volMesh>> mapSrcToTgt
|
||||
(
|
||||
const tmp<GeometricField<Type, fvPatchField, volMesh> >&
|
||||
const tmp<GeometricField<Type, fvPatchField, volMesh>>&
|
||||
tfield,
|
||||
const CombineOp& cop,
|
||||
const bool secondOrder = true
|
||||
@ -550,7 +550,7 @@ public:
|
||||
//- Convenience function to map a field with a default
|
||||
// operation (plusEqOp)
|
||||
template<class Type>
|
||||
tmp<GeometricField<Type, fvPatchField, volMesh> > mapSrcToTgt
|
||||
tmp<GeometricField<Type, fvPatchField, volMesh>> mapSrcToTgt
|
||||
(
|
||||
const GeometricField<Type, fvPatchField, volMesh>& field,
|
||||
const bool secondOrder = true
|
||||
@ -559,9 +559,9 @@ public:
|
||||
//- Convenience function to map a tmp field with a default
|
||||
// operation (plusEqOp)
|
||||
template<class Type>
|
||||
tmp<GeometricField<Type, fvPatchField, volMesh> > mapSrcToTgt
|
||||
tmp<GeometricField<Type, fvPatchField, volMesh>> mapSrcToTgt
|
||||
(
|
||||
const tmp<GeometricField<Type, fvPatchField, volMesh> >&
|
||||
const tmp<GeometricField<Type, fvPatchField, volMesh>>&
|
||||
tfield,
|
||||
const bool secondOrder = true
|
||||
) const;
|
||||
@ -585,7 +585,7 @@ public:
|
||||
//- Interpolate a field with a defined operation. The initial
|
||||
// values of the result are set to zero
|
||||
template<class Type, class CombineOp>
|
||||
tmp<GeometricField<Type, fvPatchField, volMesh> > mapTgtToSrc
|
||||
tmp<GeometricField<Type, fvPatchField, volMesh>> mapTgtToSrc
|
||||
(
|
||||
const GeometricField<Type, fvPatchField, volMesh>& field,
|
||||
const CombineOp& cop,
|
||||
@ -595,9 +595,9 @@ public:
|
||||
//- Interpolate a tmp field with a defined operation. The
|
||||
// initial values of the result are set to zero
|
||||
template<class Type, class CombineOp>
|
||||
tmp<GeometricField<Type, fvPatchField, volMesh> > mapTgtToSrc
|
||||
tmp<GeometricField<Type, fvPatchField, volMesh>> mapTgtToSrc
|
||||
(
|
||||
const tmp<GeometricField<Type, fvPatchField, volMesh> >&
|
||||
const tmp<GeometricField<Type, fvPatchField, volMesh>>&
|
||||
tfield,
|
||||
const CombineOp& cop,
|
||||
const bool secondOrder = true
|
||||
@ -606,7 +606,7 @@ public:
|
||||
//- Convenience function to map a field with a default
|
||||
// operation (plusEqOp)
|
||||
template<class Type>
|
||||
tmp<GeometricField<Type, fvPatchField, volMesh> > mapTgtToSrc
|
||||
tmp<GeometricField<Type, fvPatchField, volMesh>> mapTgtToSrc
|
||||
(
|
||||
const GeometricField<Type, fvPatchField, volMesh>& field,
|
||||
const bool secondOrder = true
|
||||
@ -615,9 +615,9 @@ public:
|
||||
//- Convenience function to map a tmp field with a default
|
||||
// operation (plusEqOp)
|
||||
template<class Type>
|
||||
tmp<GeometricField<Type, fvPatchField, volMesh> > mapTgtToSrc
|
||||
tmp<GeometricField<Type, fvPatchField, volMesh>> mapTgtToSrc
|
||||
(
|
||||
const tmp<GeometricField<Type, fvPatchField, volMesh> >&
|
||||
const tmp<GeometricField<Type, fvPatchField, volMesh>>&
|
||||
tfield,
|
||||
const bool secondOrder = true
|
||||
) const;
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2012-2014 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -64,7 +64,7 @@ Foam::label Foam::meshToMesh::calcDistribution
|
||||
procI = -1;
|
||||
if (debug)
|
||||
{
|
||||
Info<< "meshToMesh::calcDistribution: "
|
||||
InfoInFunction
|
||||
<< "Meshes split across multiple processors" << endl;
|
||||
}
|
||||
}
|
||||
@ -73,7 +73,7 @@ Foam::label Foam::meshToMesh::calcDistribution
|
||||
procI = findIndex(cellsPresentOnProc, 1);
|
||||
if (debug)
|
||||
{
|
||||
Info<< "meshToMesh::calcDistribution: "
|
||||
InfoInFunction
|
||||
<< "Meshes local to processor" << procI << endl;
|
||||
}
|
||||
}
|
||||
@ -143,7 +143,8 @@ Foam::autoPtr<Foam::mapDistribute> Foam::meshToMesh::calcProcMap
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Info<< "Determining extent of src mesh per processor:" << nl
|
||||
InfoInFunction
|
||||
<< "Determining extent of src mesh per processor:" << nl
|
||||
<< "\tproc\tbb" << endl;
|
||||
forAll(procBb, procI)
|
||||
{
|
||||
@ -161,7 +162,7 @@ Foam::autoPtr<Foam::mapDistribute> Foam::meshToMesh::calcProcMap
|
||||
|
||||
{
|
||||
// per processor indices into all segments to send
|
||||
List<DynamicList<label> > dynSendMap(Pstream::nProcs());
|
||||
List<DynamicList<label>> dynSendMap(Pstream::nProcs());
|
||||
label iniSize = floor(tgt.nCells()/Pstream::nProcs());
|
||||
|
||||
forAll(dynSendMap, procI)
|
||||
@ -584,7 +585,7 @@ void Foam::meshToMesh::distributeAndMergeCells
|
||||
|
||||
// Count any coupled faces
|
||||
typedef FixedList<label, 3> label3;
|
||||
typedef HashTable<label, label3, label3::Hash<> > procCoupleInfo;
|
||||
typedef HashTable<label, label3, label3::Hash<>> procCoupleInfo;
|
||||
procCoupleInfo procFaceToGlobalCell;
|
||||
|
||||
forAll(allNbrProcIDs, procI)
|
||||
@ -648,17 +649,14 @@ void Foam::meshToMesh::distributeAndMergeCells
|
||||
forAll(allPoints, procI)
|
||||
{
|
||||
const pointField& pts = allPoints[procI];
|
||||
SubList<point>(tgtPoints, pts.size(), pointOffset[procI]).assign(pts);
|
||||
SubList<point>(tgtPoints, pts.size(), pointOffset[procI]) = pts;
|
||||
}
|
||||
|
||||
// Insert cellIDs
|
||||
forAll(allTgtCellIDs, procI)
|
||||
{
|
||||
const labelList& cellIDs = allTgtCellIDs[procI];
|
||||
SubList<label>(tgtCellIDs, cellIDs.size(), cellOffset[procI]).assign
|
||||
(
|
||||
cellIDs
|
||||
);
|
||||
SubList<label>(tgtCellIDs, cellIDs.size(), cellOffset[procI]) = cellIDs;
|
||||
}
|
||||
|
||||
|
||||
@ -675,7 +673,7 @@ void Foam::meshToMesh::distributeAndMergeCells
|
||||
allNInternalFaces[procI],
|
||||
internalFaceOffset[procI]
|
||||
);
|
||||
slice.assign(SubList<face>(fcs, allNInternalFaces[procI]));
|
||||
slice = SubList<face>(fcs, allNInternalFaces[procI]);
|
||||
forAll(slice, i)
|
||||
{
|
||||
add(slice[i], pointOffset[procI]);
|
||||
@ -687,7 +685,7 @@ void Foam::meshToMesh::distributeAndMergeCells
|
||||
allNInternalFaces[procI],
|
||||
internalFaceOffset[procI]
|
||||
);
|
||||
ownSlice.assign(SubField<label>(faceOs, allNInternalFaces[procI]));
|
||||
ownSlice = SubField<label>(faceOs, allNInternalFaces[procI]);
|
||||
add(ownSlice, cellOffset[procI]);
|
||||
|
||||
SubField<label> nbrSlice
|
||||
@ -696,7 +694,7 @@ void Foam::meshToMesh::distributeAndMergeCells
|
||||
allNInternalFaces[procI],
|
||||
internalFaceOffset[procI]
|
||||
);
|
||||
nbrSlice.assign(SubField<label>(faceNs, allNInternalFaces[procI]));
|
||||
nbrSlice = SubField<label>(faceNs, allNInternalFaces[procI]);
|
||||
add(nbrSlice, cellOffset[procI]);
|
||||
|
||||
internalFaceOffset[procI] += allNInternalFaces[procI];
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2012-2014 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -112,6 +112,7 @@ void Foam::meshToMesh::mapSrcToTgt
|
||||
|
||||
if (srcAddress.size())
|
||||
{
|
||||
// result[cellI] = Zero;
|
||||
result[cellI] *= (1.0 - sum(srcWeight));
|
||||
forAll(srcAddress, i)
|
||||
{
|
||||
@ -131,6 +132,7 @@ void Foam::meshToMesh::mapSrcToTgt
|
||||
|
||||
if (srcAddress.size())
|
||||
{
|
||||
// result[cellI] = Zero;
|
||||
result[cellI] *= (1.0 - sum(srcWeight));
|
||||
forAll(srcAddress, i)
|
||||
{
|
||||
@ -239,31 +241,31 @@ void Foam::meshToMesh::mapSrcToTgt
|
||||
|
||||
|
||||
template<class Type, class CombineOp>
|
||||
Foam::tmp<Foam::Field<Type> > Foam::meshToMesh::mapSrcToTgt
|
||||
Foam::tmp<Foam::Field<Type>> Foam::meshToMesh::mapSrcToTgt
|
||||
(
|
||||
const Field<Type>& srcField,
|
||||
const CombineOp& cop
|
||||
) const
|
||||
{
|
||||
tmp<Field<Type> > tresult
|
||||
tmp<Field<Type>> tresult
|
||||
(
|
||||
new Field<Type>
|
||||
(
|
||||
tgtToSrcCellAddr_.size(),
|
||||
pTraits<Type>::zero
|
||||
Zero
|
||||
)
|
||||
);
|
||||
|
||||
mapSrcToTgt(srcField, cop, tresult());
|
||||
mapSrcToTgt(srcField, cop, tresult.ref());
|
||||
|
||||
return tresult;
|
||||
}
|
||||
|
||||
|
||||
template<class Type, class CombineOp>
|
||||
Foam::tmp<Foam::Field<Type> > Foam::meshToMesh::mapSrcToTgt
|
||||
Foam::tmp<Foam::Field<Type>> Foam::meshToMesh::mapSrcToTgt
|
||||
(
|
||||
const tmp<Field<Type> >& tsrcField,
|
||||
const tmp<Field<Type>>& tsrcField,
|
||||
const CombineOp& cop
|
||||
) const
|
||||
{
|
||||
@ -272,7 +274,7 @@ Foam::tmp<Foam::Field<Type> > Foam::meshToMesh::mapSrcToTgt
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::tmp<Foam::Field<Type> > Foam::meshToMesh::mapSrcToTgt
|
||||
Foam::tmp<Foam::Field<Type>> Foam::meshToMesh::mapSrcToTgt
|
||||
(
|
||||
const Field<Type>& srcField
|
||||
) const
|
||||
@ -282,9 +284,9 @@ Foam::tmp<Foam::Field<Type> > Foam::meshToMesh::mapSrcToTgt
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::tmp<Foam::Field<Type> > Foam::meshToMesh::mapSrcToTgt
|
||||
Foam::tmp<Foam::Field<Type>> Foam::meshToMesh::mapSrcToTgt
|
||||
(
|
||||
const tmp<Field<Type> >& tsrcField
|
||||
const tmp<Field<Type>>& tsrcField
|
||||
) const
|
||||
{
|
||||
return mapSrcToTgt(tsrcField());
|
||||
@ -444,31 +446,31 @@ void Foam::meshToMesh::mapTgtToSrc
|
||||
|
||||
|
||||
template<class Type, class CombineOp>
|
||||
Foam::tmp<Foam::Field<Type> > Foam::meshToMesh::mapTgtToSrc
|
||||
Foam::tmp<Foam::Field<Type>> Foam::meshToMesh::mapTgtToSrc
|
||||
(
|
||||
const Field<Type>& tgtField,
|
||||
const CombineOp& cop
|
||||
) const
|
||||
{
|
||||
tmp<Field<Type> > tresult
|
||||
tmp<Field<Type>> tresult
|
||||
(
|
||||
new Field<Type>
|
||||
(
|
||||
srcToTgtCellAddr_.size(),
|
||||
pTraits<Type>::zero
|
||||
Zero
|
||||
)
|
||||
);
|
||||
|
||||
mapTgtToSrc(tgtField, cop, tresult());
|
||||
mapTgtToSrc(tgtField, cop, tresult.ref());
|
||||
|
||||
return tresult;
|
||||
}
|
||||
|
||||
|
||||
template<class Type, class CombineOp>
|
||||
Foam::tmp<Foam::Field<Type> > Foam::meshToMesh::mapTgtToSrc
|
||||
Foam::tmp<Foam::Field<Type>> Foam::meshToMesh::mapTgtToSrc
|
||||
(
|
||||
const tmp<Field<Type> >& ttgtField,
|
||||
const tmp<Field<Type>>& ttgtField,
|
||||
const CombineOp& cop
|
||||
) const
|
||||
{
|
||||
@ -477,7 +479,7 @@ Foam::tmp<Foam::Field<Type> > Foam::meshToMesh::mapTgtToSrc
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::tmp<Foam::Field<Type> > Foam::meshToMesh::mapTgtToSrc
|
||||
Foam::tmp<Foam::Field<Type>> Foam::meshToMesh::mapTgtToSrc
|
||||
(
|
||||
const Field<Type>& tgtField
|
||||
) const
|
||||
@ -487,9 +489,9 @@ Foam::tmp<Foam::Field<Type> > Foam::meshToMesh::mapTgtToSrc
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::tmp<Foam::Field<Type> > Foam::meshToMesh::mapTgtToSrc
|
||||
Foam::tmp<Foam::Field<Type>> Foam::meshToMesh::mapTgtToSrc
|
||||
(
|
||||
const tmp<Field<Type> >& ttgtField
|
||||
const tmp<Field<Type>>& ttgtField
|
||||
) const
|
||||
{
|
||||
return mapTgtToSrc(ttgtField(), plusEqOp<Type>());
|
||||
@ -592,7 +594,6 @@ void Foam::meshToMesh::mapSrcToTgt
|
||||
// tgtField
|
||||
tgtField.rmap(tnewTgt(), identity(tgtField.size()));
|
||||
|
||||
|
||||
// Override value to account for CombineOp (note: is dummy template
|
||||
// specialisation for plusEqOp)
|
||||
mapAndOpSrcToTgt(AMIList[i], srcField, tgtField, cop);
|
||||
@ -608,7 +609,7 @@ void Foam::meshToMesh::mapSrcToTgt
|
||||
|
||||
|
||||
template<class Type, class CombineOp>
|
||||
Foam::tmp<Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh> >
|
||||
Foam::tmp<Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>>
|
||||
Foam::meshToMesh::mapSrcToTgt
|
||||
(
|
||||
const GeometricField<Type, fvPatchField, volMesh>& field,
|
||||
@ -624,7 +625,7 @@ Foam::meshToMesh::mapSrcToTgt
|
||||
const typename fieldType::GeometricBoundaryField& srcBfld =
|
||||
field.boundaryField();
|
||||
|
||||
PtrList<fvPatchField<Type> > tgtPatchFields(tgtBm.size());
|
||||
PtrList<fvPatchField<Type>> tgtPatchFields(tgtBm.size());
|
||||
|
||||
// constuct tgt boundary patch types as copy of 'field' boundary types
|
||||
// note: this will provide place holders for fields with additional
|
||||
@ -687,22 +688,22 @@ Foam::meshToMesh::mapSrcToTgt
|
||||
),
|
||||
tgtMesh,
|
||||
field.dimensions(),
|
||||
Field<Type>(tgtMesh.nCells(), pTraits<Type>::zero),
|
||||
Field<Type>(tgtMesh.nCells(), Zero),
|
||||
tgtPatchFields
|
||||
)
|
||||
);
|
||||
|
||||
mapSrcToTgt(field, cop, tresult(), secondOrder);
|
||||
mapSrcToTgt(field, cop, tresult.ref(), secondOrder);
|
||||
|
||||
return tresult;
|
||||
}
|
||||
|
||||
|
||||
template<class Type, class CombineOp>
|
||||
Foam::tmp<Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh> >
|
||||
Foam::tmp<Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>>
|
||||
Foam::meshToMesh::mapSrcToTgt
|
||||
(
|
||||
const tmp<GeometricField<Type, fvPatchField, volMesh> >& tfield,
|
||||
const tmp<GeometricField<Type, fvPatchField, volMesh>>& tfield,
|
||||
const CombineOp& cop,
|
||||
const bool secondOrder
|
||||
) const
|
||||
@ -712,7 +713,7 @@ Foam::meshToMesh::mapSrcToTgt
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::tmp<Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh> >
|
||||
Foam::tmp<Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>>
|
||||
Foam::meshToMesh::mapSrcToTgt
|
||||
(
|
||||
const GeometricField<Type, fvPatchField, volMesh>& field,
|
||||
@ -724,7 +725,7 @@ Foam::meshToMesh::mapSrcToTgt
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::tmp<Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh> >
|
||||
Foam::tmp<Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>>
|
||||
Foam::meshToMesh::mapSrcToTgt
|
||||
(
|
||||
const tmp<GeometricField<Type, fvPatchField, volMesh> >& tfield,
|
||||
@ -804,7 +805,6 @@ void Foam::meshToMesh::mapTgtToSrc
|
||||
fvPatchField<Type>& srcField = result.boundaryField()[srcPatchI];
|
||||
const fvPatchField<Type>& tgtField = field.boundaryField()[tgtPatchI];
|
||||
|
||||
|
||||
// Clone and map (since rmap does not do general mapping)
|
||||
tmp<fvPatchField<Type> > tnewSrc
|
||||
(
|
||||
@ -831,7 +831,6 @@ void Foam::meshToMesh::mapTgtToSrc
|
||||
// tgtField
|
||||
srcField.rmap(tnewSrc(), identity(srcField.size()));
|
||||
|
||||
|
||||
// Override value to account for CombineOp (could be dummy for
|
||||
// plusEqOp)
|
||||
mapAndOpTgtToSrc(AMIList[i], srcField, tgtField, cop);
|
||||
@ -847,7 +846,7 @@ void Foam::meshToMesh::mapTgtToSrc
|
||||
|
||||
|
||||
template<class Type, class CombineOp>
|
||||
Foam::tmp<Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh> >
|
||||
Foam::tmp<Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>>
|
||||
Foam::meshToMesh::mapTgtToSrc
|
||||
(
|
||||
const GeometricField<Type, fvPatchField, volMesh>& field,
|
||||
@ -863,7 +862,7 @@ Foam::meshToMesh::mapTgtToSrc
|
||||
const typename fieldType::GeometricBoundaryField& tgtBfld =
|
||||
field.boundaryField();
|
||||
|
||||
PtrList<fvPatchField<Type> > srcPatchFields(srcBm.size());
|
||||
PtrList<fvPatchField<Type>> srcPatchFields(srcBm.size());
|
||||
|
||||
// constuct src boundary patch types as copy of 'field' boundary types
|
||||
// note: this will provide place holders for fields with additional
|
||||
@ -926,22 +925,22 @@ Foam::meshToMesh::mapTgtToSrc
|
||||
),
|
||||
srcMesh,
|
||||
field.dimensions(),
|
||||
Field<Type>(srcMesh.nCells(), pTraits<Type>::zero),
|
||||
Field<Type>(srcMesh.nCells(), Zero),
|
||||
srcPatchFields
|
||||
)
|
||||
);
|
||||
|
||||
mapTgtToSrc(field, cop, tresult(), secondOrder);
|
||||
mapTgtToSrc(field, cop, tresult.ref(), secondOrder);
|
||||
|
||||
return tresult;
|
||||
}
|
||||
|
||||
|
||||
template<class Type, class CombineOp>
|
||||
Foam::tmp<Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh> >
|
||||
Foam::tmp<Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>>
|
||||
Foam::meshToMesh::mapTgtToSrc
|
||||
(
|
||||
const tmp<GeometricField<Type, fvPatchField, volMesh> >& tfield,
|
||||
const tmp<GeometricField<Type, fvPatchField, volMesh>>& tfield,
|
||||
const CombineOp& cop,
|
||||
const bool secondOrder
|
||||
) const
|
||||
@ -951,7 +950,7 @@ Foam::meshToMesh::mapTgtToSrc
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::tmp<Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh> >
|
||||
Foam::tmp<Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>>
|
||||
Foam::meshToMesh::mapTgtToSrc
|
||||
(
|
||||
const GeometricField<Type, fvPatchField, volMesh>& field,
|
||||
@ -963,10 +962,10 @@ Foam::meshToMesh::mapTgtToSrc
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::tmp<Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh> >
|
||||
Foam::tmp<Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>>
|
||||
Foam::meshToMesh::mapTgtToSrc
|
||||
(
|
||||
const tmp<GeometricField<Type, fvPatchField, volMesh> >& tfield,
|
||||
const tmp<GeometricField<Type, fvPatchField, volMesh>>& tfield,
|
||||
const bool secondOrder
|
||||
) const
|
||||
{
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -41,8 +41,8 @@ void Foam::meshToMesh0::calcAddressing()
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "meshToMesh0::calculateAddressing() : "
|
||||
<< "calculating mesh-to-mesh cell addressing" << endl;
|
||||
InfoInFunction
|
||||
<< "Calculating mesh-to-mesh cell addressing" << endl;
|
||||
}
|
||||
|
||||
// set reference to cells
|
||||
@ -62,8 +62,7 @@ void Foam::meshToMesh0::calcAddressing()
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Info<< "meshToMesh0::calculateAddressing() : "
|
||||
<< "Setting up rescue" << endl;
|
||||
InfoInFunction << "Setting up rescue" << endl;
|
||||
}
|
||||
|
||||
List<bool> boundaryCell(fromCells.size(), false);
|
||||
@ -203,8 +202,8 @@ void Foam::meshToMesh0::calcAddressing()
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Info<< "meshToMesh0::calculateAddressing() : "
|
||||
<< "finished calculating mesh-to-mesh cell addressing" << endl;
|
||||
InfoInFunction
|
||||
<< "Finished calculating mesh-to-mesh cell addressing" << endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -32,8 +32,8 @@ void Foam::meshToMesh0::calculateInverseDistanceWeights() const
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "meshToMesh0::calculateInverseDistanceWeights() : "
|
||||
<< "calculating inverse distance weighting factors" << endl;
|
||||
InfoInFunction
|
||||
<< "Calculating inverse distance weighting factors" << endl;
|
||||
}
|
||||
|
||||
if (inverseDistanceWeightsPtr_)
|
||||
@ -134,8 +134,8 @@ void Foam::meshToMesh0::calculateInverseVolumeWeights() const
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "meshToMesh0::calculateInverseVolumeWeights() : "
|
||||
<< "calculating inverse volume weighting factors" << endl;
|
||||
InfoInFunction
|
||||
<< "Calculating inverse volume weighting factors" << endl;
|
||||
}
|
||||
|
||||
if (inverseVolumeWeightsPtr_)
|
||||
@ -197,8 +197,8 @@ void Foam::meshToMesh0::calculateCellToCellAddressing() const
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "meshToMesh0::calculateCellToCellAddressing() : "
|
||||
<< "calculating cell to cell addressing" << endl;
|
||||
InfoInFunction
|
||||
<< "Calculating cell to cell addressing" << endl;
|
||||
}
|
||||
|
||||
if (cellToCellAddressingPtr_)
|
||||
@ -223,9 +223,6 @@ void Foam::meshToMesh0::calculateCellToCellAddressing() const
|
||||
overlapEngine.overlappingCells(fromMesh_, toMesh_, iTo);
|
||||
if (overLapCells.size() > 0)
|
||||
{
|
||||
//Info << "To " << iTo << endl;
|
||||
//Info << "cellToCell " << overLapCells << endl;
|
||||
|
||||
cellToCell[iTo].setSize(overLapCells.size());
|
||||
forAll(overLapCells, j)
|
||||
{
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -311,7 +311,7 @@ public:
|
||||
void interpolateInternalField
|
||||
(
|
||||
Field<Type>&,
|
||||
const tmp<GeometricField<Type, fvPatchField, volMesh> >&,
|
||||
const tmp<GeometricField<Type, fvPatchField, volMesh>>&,
|
||||
order=INTERPOLATE,
|
||||
const CombineOp& cop = eqOp<Type>()
|
||||
) const;
|
||||
@ -331,7 +331,7 @@ public:
|
||||
void interpolate
|
||||
(
|
||||
GeometricField<Type, fvPatchField, volMesh>&,
|
||||
const tmp<GeometricField<Type, fvPatchField, volMesh> >&,
|
||||
const tmp<GeometricField<Type, fvPatchField, volMesh>>&,
|
||||
order=INTERPOLATE,
|
||||
const CombineOp& cop = eqOp<Type>()
|
||||
) const;
|
||||
@ -339,7 +339,7 @@ public:
|
||||
|
||||
//- Interpolate volume field
|
||||
template<class Type, class CombineOp>
|
||||
tmp<GeometricField<Type, fvPatchField, volMesh> > interpolate
|
||||
tmp<GeometricField<Type, fvPatchField, volMesh>> interpolate
|
||||
(
|
||||
const GeometricField<Type, fvPatchField, volMesh>&,
|
||||
order=INTERPOLATE,
|
||||
@ -347,9 +347,9 @@ public:
|
||||
) const;
|
||||
|
||||
template<class Type, class CombineOp>
|
||||
tmp<GeometricField<Type, fvPatchField, volMesh> > interpolate
|
||||
tmp<GeometricField<Type, fvPatchField, volMesh>> interpolate
|
||||
(
|
||||
const tmp<GeometricField<Type, fvPatchField, volMesh> >&,
|
||||
const tmp<GeometricField<Type, fvPatchField, volMesh>>&,
|
||||
order=INTERPOLATE,
|
||||
const CombineOp& cop = eqOp<Type>()
|
||||
) const;
|
||||
@ -363,7 +363,7 @@ public:
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
# include "meshToMesh0Templates.C"
|
||||
#include "meshToMesh0Templates.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -70,7 +70,7 @@ void Foam::meshToMesh0::interpolateField
|
||||
const labelList& overlapCells = adr[celli];
|
||||
const scalarList& w = weights[celli];
|
||||
|
||||
Type f = pTraits<Type>::zero;
|
||||
Type f = Zero;
|
||||
forAll(overlapCells, i)
|
||||
{
|
||||
label fromCelli = overlapCells[i];
|
||||
@ -232,7 +232,7 @@ template<class Type, class CombineOp>
|
||||
void Foam::meshToMesh0::interpolateInternalField
|
||||
(
|
||||
Field<Type>& toF,
|
||||
const tmp<GeometricField<Type, fvPatchField, volMesh> >& tfromVf,
|
||||
const tmp<GeometricField<Type, fvPatchField, volMesh>>& tfromVf,
|
||||
meshToMesh0::order ord,
|
||||
const CombineOp& cop
|
||||
) const
|
||||
@ -310,9 +310,9 @@ void Foam::meshToMesh0::interpolate
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
if (isA<mixedFvPatchField<Type> >(toVf.boundaryField()[patchi]))
|
||||
if (isA<mixedFvPatchField<Type>>(toVf.boundaryField()[patchi]))
|
||||
{
|
||||
refCast<mixedFvPatchField<Type> >
|
||||
refCast<mixedFvPatchField<Type>>
|
||||
(
|
||||
toVf.boundaryField()[patchi]
|
||||
).refValue() = toVf.boundaryField()[patchi];
|
||||
@ -354,7 +354,7 @@ template<class Type, class CombineOp>
|
||||
void Foam::meshToMesh0::interpolate
|
||||
(
|
||||
GeometricField<Type, fvPatchField, volMesh>& toVf,
|
||||
const tmp<GeometricField<Type, fvPatchField, volMesh> >& tfromVf,
|
||||
const tmp<GeometricField<Type, fvPatchField, volMesh>>& tfromVf,
|
||||
meshToMesh0::order ord,
|
||||
const CombineOp& cop
|
||||
) const
|
||||
@ -365,7 +365,7 @@ void Foam::meshToMesh0::interpolate
|
||||
|
||||
|
||||
template<class Type, class CombineOp>
|
||||
Foam::tmp< Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh> >
|
||||
Foam::tmp<Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>>
|
||||
Foam::meshToMesh0::interpolate
|
||||
(
|
||||
const GeometricField<Type, fvPatchField, volMesh>& fromVf,
|
||||
@ -388,7 +388,7 @@ Foam::meshToMesh0::interpolate
|
||||
}
|
||||
|
||||
// Create and map the patch field values
|
||||
PtrList<fvPatchField<Type> > patchFields
|
||||
PtrList<fvPatchField<Type>> patchFields
|
||||
(
|
||||
boundaryAddressing_.size()
|
||||
);
|
||||
@ -413,7 +413,7 @@ Foam::meshToMesh0::interpolate
|
||||
|
||||
|
||||
// Create the complete field from the pieces
|
||||
tmp<GeometricField<Type, fvPatchField, volMesh> > ttoF
|
||||
tmp<GeometricField<Type, fvPatchField, volMesh>> ttoF
|
||||
(
|
||||
new GeometricField<Type, fvPatchField, volMesh>
|
||||
(
|
||||
@ -437,15 +437,15 @@ Foam::meshToMesh0::interpolate
|
||||
|
||||
|
||||
template<class Type, class CombineOp>
|
||||
Foam::tmp< Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh> >
|
||||
Foam::tmp<Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>>
|
||||
Foam::meshToMesh0::interpolate
|
||||
(
|
||||
const tmp<GeometricField<Type, fvPatchField, volMesh> >& tfromVf,
|
||||
const tmp<GeometricField<Type, fvPatchField, volMesh>>& tfromVf,
|
||||
meshToMesh0::order ord,
|
||||
const CombineOp& cop
|
||||
) const
|
||||
{
|
||||
tmp<GeometricField<Type, fvPatchField, volMesh> > tint =
|
||||
tmp<GeometricField<Type, fvPatchField, volMesh>> tint =
|
||||
interpolate(tfromVf(), ord, cop);
|
||||
tfromVf.clear();
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -26,7 +26,6 @@ License
|
||||
#include "patchProbes.H"
|
||||
#include "volFields.H"
|
||||
#include "IOmanip.H"
|
||||
// For 'nearInfo' helper class only
|
||||
#include "mappedPatchBase.H"
|
||||
#include "treeBoundBox.H"
|
||||
#include "treeDataFace.H"
|
||||
@ -172,7 +171,7 @@ void Foam::patchProbes::findElements(const fvMesh& mesh)
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Info<< "patchProbes::findElements" << " : " << endl;
|
||||
InfoInFunction << endl;
|
||||
forAll(nearest, sampleI)
|
||||
{
|
||||
label procI = nearest[sampleI].second().second();
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -128,21 +128,21 @@ protected:
|
||||
|
||||
//- Sample a volume field at all locations
|
||||
template<class Type>
|
||||
tmp<Field<Type> > sample
|
||||
tmp<Field<Type>> sample
|
||||
(
|
||||
const GeometricField<Type, fvPatchField, volMesh>&
|
||||
) const;
|
||||
|
||||
//- Sample a surface field at all locations
|
||||
template<class Type>
|
||||
tmp<Field<Type> > sample
|
||||
tmp<Field<Type>> sample
|
||||
(
|
||||
const GeometricField<Type, fvsPatchField, surfaceMesh>&
|
||||
) const;
|
||||
|
||||
//- Sample a single field on all sample locations
|
||||
template<class Type>
|
||||
tmp<Field<Type> > sample(const word& fieldName) const;
|
||||
tmp<Field<Type>> sample(const word& fieldName) const;
|
||||
|
||||
//- Find elements containing patchProbes
|
||||
virtual void findElements(const fvMesh&);
|
||||
@ -199,7 +199,7 @@ public:
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
# include "patchProbesTemplates.C"
|
||||
#include "patchProbesTemplates.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -123,7 +123,7 @@ void Foam::patchProbes::sampleAndWrite
|
||||
sampleAndWrite
|
||||
(
|
||||
mesh_.lookupObject
|
||||
<GeometricField<Type, fvPatchField, volMesh> >
|
||||
<GeometricField<Type, fvPatchField, volMesh>>
|
||||
(
|
||||
fields[fieldI]
|
||||
)
|
||||
@ -175,7 +175,7 @@ void Foam::patchProbes::sampleAndWriteSurfaceFields
|
||||
sampleAndWrite
|
||||
(
|
||||
mesh_.lookupObject
|
||||
<GeometricField<Type, fvsPatchField, surfaceMesh> >
|
||||
<GeometricField<Type, fvsPatchField, surfaceMesh>>
|
||||
(
|
||||
fields[fieldI]
|
||||
)
|
||||
@ -189,7 +189,7 @@ void Foam::patchProbes::sampleAndWriteSurfaceFields
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
Foam::tmp<Foam::Field<Type> >
|
||||
Foam::tmp<Foam::Field<Type>>
|
||||
Foam::patchProbes::sample
|
||||
(
|
||||
const GeometricField<Type, fvPatchField, volMesh>& vField
|
||||
@ -197,12 +197,12 @@ Foam::patchProbes::sample
|
||||
{
|
||||
const Type unsetVal(-VGREAT*pTraits<Type>::one);
|
||||
|
||||
tmp<Field<Type> > tValues
|
||||
tmp<Field<Type>> tValues
|
||||
(
|
||||
new Field<Type>(this->size(), unsetVal)
|
||||
);
|
||||
|
||||
Field<Type>& values = tValues();
|
||||
Field<Type>& values = tValues.ref();
|
||||
|
||||
const polyBoundaryMesh& patches = mesh_.boundaryMesh();
|
||||
|
||||
@ -226,12 +226,12 @@ Foam::patchProbes::sample
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::tmp<Foam::Field<Type> >
|
||||
Foam::tmp<Foam::Field<Type>>
|
||||
Foam::patchProbes::sample(const word& fieldName) const
|
||||
{
|
||||
return sample
|
||||
(
|
||||
mesh_.lookupObject<GeometricField<Type, fvPatchField, volMesh> >
|
||||
mesh_.lookupObject<GeometricField<Type, fvPatchField, volMesh>>
|
||||
(
|
||||
fieldName
|
||||
)
|
||||
@ -240,7 +240,7 @@ Foam::patchProbes::sample(const word& fieldName) const
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::tmp<Foam::Field<Type> >
|
||||
Foam::tmp<Foam::Field<Type>>
|
||||
Foam::patchProbes::sample
|
||||
(
|
||||
const GeometricField<Type, fvsPatchField, surfaceMesh>& sField
|
||||
@ -248,12 +248,12 @@ Foam::patchProbes::sample
|
||||
{
|
||||
const Type unsetVal(-VGREAT*pTraits<Type>::one);
|
||||
|
||||
tmp<Field<Type> > tValues
|
||||
tmp<Field<Type>> tValues
|
||||
(
|
||||
new Field<Type>(this->size(), unsetVal)
|
||||
);
|
||||
|
||||
Field<Type>& values = tValues();
|
||||
Field<Type>& values = tValues.ref();
|
||||
|
||||
const polyBoundaryMesh& patches = mesh_.boundaryMesh();
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -67,7 +67,7 @@ void Foam::probes::findElements(const fvMesh& mesh)
|
||||
const vector& cellCentre = mesh.cellCentres()[cellI];
|
||||
scalar minDistance = GREAT;
|
||||
label minFaceID = -1;
|
||||
forAll (cellFaces, i)
|
||||
forAll(cellFaces, i)
|
||||
{
|
||||
label faceI = cellFaces[i];
|
||||
vector dist = mesh.faceCentres()[faceI] - cellCentre;
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -313,22 +313,22 @@ public:
|
||||
|
||||
//- Sample a volume field at all locations
|
||||
template<class Type>
|
||||
tmp<Field<Type> > sample
|
||||
tmp<Field<Type>> sample
|
||||
(
|
||||
const GeometricField<Type, fvPatchField, volMesh>&
|
||||
) const;
|
||||
|
||||
//- Sample a single vol field on all sample locations
|
||||
template<class Type>
|
||||
tmp<Field<Type> > sample(const word& fieldName) const;
|
||||
tmp<Field<Type>> sample(const word& fieldName) const;
|
||||
|
||||
//- Sample a single scalar field on all sample locations
|
||||
template<class Type>
|
||||
tmp<Field<Type> > sampleSurfaceFields(const word& fieldName) const;
|
||||
tmp<Field<Type>> sampleSurfaceFields(const word& fieldName) const;
|
||||
|
||||
//- Sample a surface field at all locations
|
||||
template<class Type>
|
||||
tmp<Field<Type> > sample
|
||||
tmp<Field<Type>> sample
|
||||
(
|
||||
const GeometricField<Type, fvsPatchField, surfaceMesh>&
|
||||
) const;
|
||||
@ -342,7 +342,7 @@ public:
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
# include "probesTemplates.C"
|
||||
#include "probesTemplates.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -34,7 +34,6 @@ License
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
//- Comparison operator for probes class
|
||||
template<class T>
|
||||
class isNotEqOp
|
||||
{
|
||||
@ -150,7 +149,7 @@ void Foam::probes::sampleAndWrite(const fieldGroup<Type>& fields)
|
||||
sampleAndWrite
|
||||
(
|
||||
mesh_.lookupObject
|
||||
<GeometricField<Type, fvPatchField, volMesh> >
|
||||
<GeometricField<Type, fvPatchField, volMesh>>
|
||||
(
|
||||
fields[fieldI]
|
||||
)
|
||||
@ -199,7 +198,7 @@ void Foam::probes::sampleAndWriteSurfaceFields(const fieldGroup<Type>& fields)
|
||||
sampleAndWrite
|
||||
(
|
||||
mesh_.lookupObject
|
||||
<GeometricField<Type, fvsPatchField, surfaceMesh> >
|
||||
<GeometricField<Type, fvsPatchField, surfaceMesh>>
|
||||
(
|
||||
fields[fieldI]
|
||||
)
|
||||
@ -212,7 +211,7 @@ void Foam::probes::sampleAndWriteSurfaceFields(const fieldGroup<Type>& fields)
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
Foam::tmp<Foam::Field<Type> >
|
||||
Foam::tmp<Foam::Field<Type>>
|
||||
Foam::probes::sample
|
||||
(
|
||||
const GeometricField<Type, fvPatchField, volMesh>& vField
|
||||
@ -220,16 +219,16 @@ Foam::probes::sample
|
||||
{
|
||||
const Type unsetVal(-VGREAT*pTraits<Type>::one);
|
||||
|
||||
tmp<Field<Type> > tValues
|
||||
tmp<Field<Type>> tValues
|
||||
(
|
||||
new Field<Type>(this->size(), unsetVal)
|
||||
);
|
||||
|
||||
Field<Type>& values = tValues();
|
||||
Field<Type>& values = tValues.ref();
|
||||
|
||||
if (fixedLocations_)
|
||||
{
|
||||
autoPtr<interpolation<Type> > interpolator
|
||||
autoPtr<interpolation<Type>> interpolator
|
||||
(
|
||||
interpolation<Type>::New(interpolationScheme_, vField)
|
||||
);
|
||||
@ -268,12 +267,12 @@ Foam::probes::sample
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::tmp<Foam::Field<Type> >
|
||||
Foam::tmp<Foam::Field<Type>>
|
||||
Foam::probes::sample(const word& fieldName) const
|
||||
{
|
||||
return sample
|
||||
(
|
||||
mesh_.lookupObject<GeometricField<Type, fvPatchField, volMesh> >
|
||||
mesh_.lookupObject<GeometricField<Type, fvPatchField, volMesh>>
|
||||
(
|
||||
fieldName
|
||||
)
|
||||
@ -282,7 +281,7 @@ Foam::probes::sample(const word& fieldName) const
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::tmp<Foam::Field<Type> >
|
||||
Foam::tmp<Foam::Field<Type>>
|
||||
Foam::probes::sample
|
||||
(
|
||||
const GeometricField<Type, fvsPatchField, surfaceMesh>& sField
|
||||
@ -290,12 +289,12 @@ Foam::probes::sample
|
||||
{
|
||||
const Type unsetVal(-VGREAT*pTraits<Type>::one);
|
||||
|
||||
tmp<Field<Type> > tValues
|
||||
tmp<Field<Type>> tValues
|
||||
(
|
||||
new Field<Type>(this->size(), unsetVal)
|
||||
);
|
||||
|
||||
Field<Type>& values = tValues();
|
||||
Field<Type>& values = tValues.ref();
|
||||
|
||||
forAll(*this, probeI)
|
||||
{
|
||||
@ -313,12 +312,12 @@ Foam::probes::sample
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::tmp<Foam::Field<Type> >
|
||||
Foam::tmp<Foam::Field<Type>>
|
||||
Foam::probes::sampleSurfaceFields(const word& fieldName) const
|
||||
{
|
||||
return sample
|
||||
(
|
||||
mesh_.lookupObject<GeometricField<Type, fvsPatchField, surfaceMesh> >
|
||||
mesh_.lookupObject<GeometricField<Type, fvsPatchField, surfaceMesh>>
|
||||
(
|
||||
fieldName
|
||||
)
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -36,6 +36,8 @@ namespace Foam
|
||||
{
|
||||
defineTypeNameAndDebug(faceOnlySet, 0);
|
||||
addToRunTimeSelectionTable(sampledSet, faceOnlySet, word);
|
||||
|
||||
const scalar faceOnlySet::tol = 1e-6;
|
||||
}
|
||||
|
||||
|
||||
@ -45,20 +47,15 @@ bool Foam::faceOnlySet::trackToBoundary
|
||||
(
|
||||
passiveParticleCloud& particleCloud,
|
||||
passiveParticle& singleParticle,
|
||||
const scalar smallDist,
|
||||
DynamicList<point>& samplingPts,
|
||||
DynamicList<label>& samplingCells,
|
||||
DynamicList<label>& samplingFaces,
|
||||
DynamicList<scalar>& samplingCurveDist
|
||||
) const
|
||||
{
|
||||
// distance vector between sampling points
|
||||
const vector offset = end_ - start_;
|
||||
const vector smallVec = tol*offset;
|
||||
const scalar smallDist = mag(smallVec);
|
||||
|
||||
particle::TrackingData<passiveParticleCloud> trackData(particleCloud);
|
||||
|
||||
// Alias
|
||||
const point& trackPt = singleParticle.position();
|
||||
|
||||
while(true)
|
||||
@ -78,12 +75,12 @@ bool Foam::faceOnlySet::trackToBoundary
|
||||
|
||||
if (mag(trackPt - end_) < smallDist)
|
||||
{
|
||||
// end reached
|
||||
// End reached
|
||||
return false;
|
||||
}
|
||||
else if (singleParticle.onBoundary())
|
||||
{
|
||||
// Boundary reached.
|
||||
// Boundary reached
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -99,7 +96,7 @@ void Foam::faceOnlySet::calcSamples
|
||||
DynamicList<scalar>& samplingCurveDist
|
||||
) const
|
||||
{
|
||||
// distance vector between sampling points
|
||||
// Distance vector between sampling points
|
||||
if (mag(end_ - start_) < SMALL)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
@ -136,31 +133,29 @@ void Foam::faceOnlySet::calcSamples
|
||||
}
|
||||
|
||||
// Get first tracking point. Use bPoint, bFaceI if provided.
|
||||
|
||||
point trackPt;
|
||||
label trackCellI = -1;
|
||||
label trackFaceI = -1;
|
||||
|
||||
//Info<< "before getTrackingPoint : bPoint:" << bPoint
|
||||
// << " bFaceI:" << bFaceI << endl;
|
||||
// Pout<< "before getTrackingPoint : bPoint:" << bPoint
|
||||
// << " bFaceI:" << bFaceI << endl;
|
||||
|
||||
getTrackingPoint
|
||||
(
|
||||
offset,
|
||||
start_,
|
||||
bPoint,
|
||||
bFaceI,
|
||||
|
||||
smallDist,
|
||||
trackPt,
|
||||
trackCellI,
|
||||
trackFaceI
|
||||
);
|
||||
|
||||
//Info<< "after getTrackingPoint : "
|
||||
// << " trackPt:" << trackPt
|
||||
// << " trackCellI:" << trackCellI
|
||||
// << " trackFaceI:" << trackFaceI
|
||||
// << endl;
|
||||
// Pout<< "after getTrackingPoint : "
|
||||
// << " trackPt:" << trackPt
|
||||
// << " trackCellI:" << trackCellI
|
||||
// << " trackFaceI:" << trackFaceI
|
||||
// << endl;
|
||||
|
||||
if (trackCellI == -1)
|
||||
{
|
||||
@ -180,11 +175,11 @@ void Foam::faceOnlySet::calcSamples
|
||||
trackFaceI = findNearFace(trackCellI, trackPt, smallDist);
|
||||
}
|
||||
|
||||
//Info<< "calcSamples : got first point to track from :"
|
||||
// << " trackPt:" << trackPt
|
||||
// << " trackCell:" << trackCellI
|
||||
// << " trackFace:" << trackFaceI
|
||||
// << endl;
|
||||
// Pout<< "calcSamples : got first point to track from :"
|
||||
// << " trackPt:" << trackPt
|
||||
// << " trackCell:" << trackCellI
|
||||
// << " trackFace:" << trackFaceI
|
||||
// << endl;
|
||||
|
||||
//
|
||||
// Track until hit end of all boundary intersections
|
||||
@ -199,11 +194,11 @@ void Foam::faceOnlySet::calcSamples
|
||||
// index in bHits; current boundary intersection
|
||||
label bHitI = 1;
|
||||
|
||||
while(true)
|
||||
while (true)
|
||||
{
|
||||
if (trackFaceI != -1)
|
||||
{
|
||||
//Info<< "trackPt:" << trackPt << " on face so use." << endl;
|
||||
// Pout<< "trackPt:" << trackPt << " on face so use." << endl;
|
||||
samplingPts.append(trackPt);
|
||||
samplingCells.append(trackCellI);
|
||||
samplingFaces.append(trackFaceI);
|
||||
@ -222,32 +217,27 @@ void Foam::faceOnlySet::calcSamples
|
||||
(
|
||||
particleCloud,
|
||||
singleParticle,
|
||||
smallDist,
|
||||
samplingPts,
|
||||
samplingCells,
|
||||
samplingFaces,
|
||||
samplingCurveDist
|
||||
);
|
||||
|
||||
// fill sampleSegments
|
||||
// Fill sampleSegments
|
||||
for (label i = samplingPts.size() - 1; i >= startSegmentI; --i)
|
||||
{
|
||||
samplingSegments.append(segmentI);
|
||||
}
|
||||
|
||||
|
||||
if (!reachedBoundary)
|
||||
{
|
||||
//Info<< "calcSamples : Reached end of samples: "
|
||||
// << " samplePt now:" << singleParticle.position()
|
||||
// << endl;
|
||||
// Pout<< "calcSamples : Reached end of samples: "
|
||||
// << " samplePt now:" << singleParticle.position()
|
||||
// << endl;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
// Go past boundary intersection where tracking stopped
|
||||
// Use coordinate comparison instead of face comparison for
|
||||
// accuracy reasons
|
||||
|
||||
bool foundValidB = false;
|
||||
|
||||
while (bHitI < bHits.size())
|
||||
@ -256,15 +246,15 @@ void Foam::faceOnlySet::calcSamples
|
||||
(bHits[bHitI].hitPoint() - singleParticle.position())
|
||||
& normOffset;
|
||||
|
||||
//Info<< "Finding next boundary : "
|
||||
// << "bPoint:" << bHits[bHitI].hitPoint()
|
||||
// << " tracking:" << singleParticle.position()
|
||||
// << " dist:" << dist
|
||||
// << endl;
|
||||
// Pout<< "Finding next boundary : "
|
||||
// << "bPoint:" << bHits[bHitI].hitPoint()
|
||||
// << " tracking:" << singleParticle.position()
|
||||
// << " dist:" << dist
|
||||
// << endl;
|
||||
|
||||
if (dist > smallDist)
|
||||
{
|
||||
// hitpoint is past tracking position
|
||||
// Hit-point is past tracking position
|
||||
foundValidB = true;
|
||||
break;
|
||||
}
|
||||
@ -274,7 +264,7 @@ void Foam::faceOnlySet::calcSamples
|
||||
}
|
||||
}
|
||||
|
||||
if (!foundValidB)
|
||||
if (!foundValidB || bHitI == bHits.size() - 1)
|
||||
{
|
||||
// No valid boundary intersection found beyond tracking position
|
||||
break;
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -70,6 +70,7 @@ class faceOnlySet
|
||||
(
|
||||
passiveParticleCloud& particleCloud,
|
||||
passiveParticle& singleParticle,
|
||||
const scalar smallDist,
|
||||
DynamicList<point>& samplingPts,
|
||||
DynamicList<label>& samplingCells,
|
||||
DynamicList<label>& samplingFaces,
|
||||
@ -96,6 +97,14 @@ public:
|
||||
//- Runtime type information
|
||||
TypeName("face");
|
||||
|
||||
|
||||
// Static data
|
||||
|
||||
//- Tolerance when comparing points relative to difference between
|
||||
// start_ and end_
|
||||
static const scalar tol;
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -25,6 +25,7 @@ License
|
||||
|
||||
#include "midPointSet.H"
|
||||
#include "polyMesh.H"
|
||||
#include "meshSearch.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
@ -47,58 +48,46 @@ void Foam::midPointSet::genSamples()
|
||||
labelList midSegments(2*size());
|
||||
scalarList midCurveDist(2*size());
|
||||
|
||||
label midI = 0;
|
||||
label mSamplei = 0;
|
||||
label samplei = 0;
|
||||
|
||||
label sampleI = 0;
|
||||
|
||||
while(true && size()>0)
|
||||
while (size() > 0)
|
||||
{
|
||||
// calculate midpoint between sampleI and sampleI+1 (if in same segment)
|
||||
// Calculate midpoint between samplei and samplei+1 (if in same segment)
|
||||
while
|
||||
(
|
||||
(sampleI < size() - 1)
|
||||
&& (segments_[sampleI] == segments_[sampleI+1])
|
||||
(samplei < size() - 1)
|
||||
&& (segments_[samplei] == segments_[samplei+1])
|
||||
)
|
||||
{
|
||||
midPoints[midI] =
|
||||
0.5*(operator[](sampleI) + operator[](sampleI+1));
|
||||
point midPoint(0.5*(operator[](samplei) + operator[](samplei+1)));
|
||||
label cellm = pointInCell(midPoint, samplei);
|
||||
|
||||
label cell1 = getCell(faces_[sampleI], midPoints[midI]);
|
||||
label cell2 = getCell(faces_[sampleI+1], midPoints[midI]);
|
||||
|
||||
if (cell1 != cell2)
|
||||
if (cellm != -1)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< " midI:" << midI
|
||||
<< " sampleI:" << sampleI
|
||||
<< " pts[sampleI]:" << operator[](sampleI)
|
||||
<< " face[sampleI]:" << faces_[sampleI]
|
||||
<< " pts[sampleI+1]:" << operator[](sampleI+1)
|
||||
<< " face[sampleI+1]:" << faces_[sampleI+1]
|
||||
<< " cell1:" << cell1
|
||||
<< " cell2:" << cell2
|
||||
<< abort(FatalError);
|
||||
midPoints[mSamplei] = midPoint;
|
||||
midCells[mSamplei] = cellm;
|
||||
midSegments[mSamplei] = segments_[samplei];
|
||||
midCurveDist[mSamplei] = mag(midPoints[mSamplei] - start());
|
||||
mSamplei++;
|
||||
}
|
||||
|
||||
midCells[midI] = cell1;
|
||||
midSegments[midI] = segments_[sampleI];
|
||||
midCurveDist[midI] = mag(midPoints[midI] - start());
|
||||
|
||||
midI++;
|
||||
sampleI++;
|
||||
samplei++;
|
||||
}
|
||||
|
||||
if (sampleI == size() - 1)
|
||||
if (samplei == size() - 1)
|
||||
{
|
||||
break;
|
||||
}
|
||||
sampleI++;
|
||||
|
||||
samplei++;
|
||||
}
|
||||
|
||||
midPoints.setSize(midI);
|
||||
midCells.setSize(midI);
|
||||
midSegments.setSize(midI);
|
||||
midCurveDist.setSize(midI);
|
||||
midPoints.setSize(mSamplei);
|
||||
midCells.setSize(mSamplei);
|
||||
midSegments.setSize(mSamplei);
|
||||
midCurveDist.setSize(mSamplei);
|
||||
|
||||
setSamples
|
||||
(
|
||||
midPoints,
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -39,101 +39,83 @@ namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
// Rework faceOnlySet samples.
|
||||
// Take two consecutive samples
|
||||
void Foam::midPointAndFaceSet::genSamples()
|
||||
{
|
||||
// Generate midpoints and add to face points
|
||||
|
||||
List<point> newSamplePoints(3*size());
|
||||
labelList newSampleCells(3*size());
|
||||
labelList newSampleFaces(3*size());
|
||||
labelList newSampleSegments(3*size());
|
||||
scalarList newSampleCurveDist(3*size());
|
||||
List<point> mpfSamplePoints(3*size());
|
||||
labelList mpfSampleCells(3*size());
|
||||
labelList mpfSampleFaces(3*size());
|
||||
labelList mpfSampleSegments(3*size());
|
||||
scalarList mpfSampleCurveDist(3*size());
|
||||
|
||||
label newSampleI = 0;
|
||||
label mpfSamplei = 0;
|
||||
label samplei = 0;
|
||||
|
||||
label sampleI = 0;
|
||||
|
||||
while(true && size()>0)
|
||||
while (size() > 0)
|
||||
{
|
||||
// sampleI is start of segment
|
||||
|
||||
// Add sampleI
|
||||
newSamplePoints[newSampleI] = operator[](sampleI);
|
||||
newSampleCells[newSampleI] = cells_[sampleI];
|
||||
newSampleFaces[newSampleI] = faces_[sampleI];
|
||||
newSampleSegments[newSampleI] = segments_[sampleI];
|
||||
newSampleCurveDist[newSampleI] = curveDist_[sampleI];
|
||||
newSampleI++;
|
||||
// Add first face
|
||||
mpfSamplePoints[mpfSamplei] = operator[](samplei);
|
||||
mpfSampleCells[mpfSamplei] = cells_[samplei];
|
||||
mpfSampleFaces[mpfSamplei] = faces_[samplei];
|
||||
mpfSampleSegments[mpfSamplei] = segments_[samplei];
|
||||
mpfSampleCurveDist[mpfSamplei] = curveDist_[samplei];
|
||||
mpfSamplei++;
|
||||
|
||||
while
|
||||
(
|
||||
(sampleI < size() - 1)
|
||||
&& (segments_[sampleI] == segments_[sampleI+1])
|
||||
(samplei < size() - 1)
|
||||
&& (segments_[samplei] == segments_[samplei+1])
|
||||
)
|
||||
{
|
||||
// Add mid point
|
||||
const point mid = 0.5*(operator[](sampleI) + operator[](sampleI+1));
|
||||
point midPoint(0.5*(operator[](samplei) + operator[](samplei+1)));
|
||||
label cellm = pointInCell(midPoint, samplei);
|
||||
|
||||
label cell1 = getCell(faces_[sampleI], mid);
|
||||
label cell2 = getCell(faces_[sampleI+1], mid);
|
||||
|
||||
if (cell1 != cell2)
|
||||
if (cellm != -1)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< " newSampleI:" << newSampleI
|
||||
<< " pts[sampleI]:" << operator[](sampleI)
|
||||
<< " face[sampleI]:" << faces_[sampleI]
|
||||
<< " pts[sampleI+1]:" << operator[](sampleI+1)
|
||||
<< " face[sampleI+1]:" << faces_[sampleI+1]
|
||||
<< " cell1:" << cell1
|
||||
<< " cell2:" << cell2
|
||||
<< abort(FatalError);
|
||||
mpfSamplePoints[mpfSamplei] = midPoint;
|
||||
mpfSampleCells[mpfSamplei] = cellm;
|
||||
mpfSampleFaces[mpfSamplei] = -1;
|
||||
mpfSampleSegments[mpfSamplei] = segments_[samplei];
|
||||
mpfSampleCurveDist[mpfSamplei] =
|
||||
mag(mpfSamplePoints[mpfSamplei] - start());
|
||||
|
||||
mpfSamplei++;
|
||||
}
|
||||
|
||||
newSamplePoints[newSampleI] = mid;
|
||||
newSampleCells[newSampleI] = cell1;
|
||||
newSampleFaces[newSampleI] = -1;
|
||||
newSampleSegments[newSampleI] = segments_[sampleI];
|
||||
newSampleCurveDist[newSampleI] =
|
||||
mag(newSamplePoints[newSampleI] - start());
|
||||
// Add second face
|
||||
mpfSamplePoints[mpfSamplei] = operator[](samplei+1);
|
||||
mpfSampleCells[mpfSamplei] = cells_[samplei+1];
|
||||
mpfSampleFaces[mpfSamplei] = faces_[samplei+1];
|
||||
mpfSampleSegments[mpfSamplei] = segments_[samplei+1];
|
||||
mpfSampleCurveDist[mpfSamplei] =
|
||||
mag(mpfSamplePoints[mpfSamplei] - start());
|
||||
|
||||
newSampleI++;
|
||||
mpfSamplei++;
|
||||
|
||||
// Add sampleI+1
|
||||
newSamplePoints[newSampleI] = operator[](sampleI+1);
|
||||
newSampleCells[newSampleI] = cells_[sampleI+1];
|
||||
newSampleFaces[newSampleI] = faces_[sampleI+1];
|
||||
newSampleSegments[newSampleI] = segments_[sampleI+1];
|
||||
newSampleCurveDist[newSampleI] =
|
||||
mag(newSamplePoints[newSampleI] - start());
|
||||
|
||||
newSampleI++;
|
||||
|
||||
sampleI++;
|
||||
samplei++;
|
||||
}
|
||||
|
||||
if (sampleI == size() - 1)
|
||||
if (samplei == size() - 1)
|
||||
{
|
||||
break;
|
||||
}
|
||||
sampleI++;
|
||||
samplei++;
|
||||
}
|
||||
|
||||
newSamplePoints.setSize(newSampleI);
|
||||
newSampleCells.setSize(newSampleI);
|
||||
newSampleFaces.setSize(newSampleI);
|
||||
newSampleSegments.setSize(newSampleI);
|
||||
newSampleCurveDist.setSize(newSampleI);
|
||||
mpfSamplePoints.setSize(mpfSamplei);
|
||||
mpfSampleCells.setSize(mpfSamplei);
|
||||
mpfSampleFaces.setSize(mpfSamplei);
|
||||
mpfSampleSegments.setSize(mpfSamplei);
|
||||
mpfSampleCurveDist.setSize(mpfSamplei);
|
||||
|
||||
setSamples
|
||||
(
|
||||
newSamplePoints,
|
||||
newSampleCells,
|
||||
newSampleFaces,
|
||||
newSampleSegments,
|
||||
newSampleCurveDist
|
||||
mpfSamplePoints,
|
||||
mpfSampleCells,
|
||||
mpfSampleFaces,
|
||||
mpfSampleSegments,
|
||||
mpfSampleCurveDist
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -36,6 +36,8 @@ namespace Foam
|
||||
{
|
||||
defineTypeNameAndDebug(polyLineSet, 0);
|
||||
addToRunTimeSelectionTable(sampledSet, polyLineSet, word);
|
||||
|
||||
const scalar polyLineSet::tol = 1e-6;
|
||||
}
|
||||
|
||||
|
||||
@ -205,10 +207,10 @@ void Foam::polyLineSet::calcSamples
|
||||
bool isSample =
|
||||
getTrackingPoint
|
||||
(
|
||||
sampleCoords_[sampleI+1] - sampleCoords_[sampleI],
|
||||
sampleCoords_[sampleI],
|
||||
bPoint,
|
||||
bFaceI,
|
||||
smallDist,
|
||||
|
||||
trackPt,
|
||||
trackCellI,
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -95,6 +95,13 @@ public:
|
||||
TypeName("polyLine");
|
||||
|
||||
|
||||
// Static data
|
||||
|
||||
//- Tolerance when comparing points relative to difference between
|
||||
// start_ and end_
|
||||
static const scalar tol;
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -34,8 +34,6 @@ License
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
const scalar sampledSet::tol = 1e-6;
|
||||
|
||||
defineTypeNameAndDebug(sampledSet, 0);
|
||||
defineRunTimeSelectionTable(sampledSet, word);
|
||||
}
|
||||
@ -49,61 +47,88 @@ Foam::label Foam::sampledSet::getBoundaryCell(const label faceI) const
|
||||
}
|
||||
|
||||
|
||||
Foam::label Foam::sampledSet::getCell
|
||||
(
|
||||
const label faceI,
|
||||
const point& sample
|
||||
) const
|
||||
Foam::label Foam::sampledSet::getNeighbourCell(const label faceI) const
|
||||
{
|
||||
if (faceI == -1)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Illegal face label " << faceI
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
if (faceI >= mesh().nInternalFaces())
|
||||
{
|
||||
label cellI = getBoundaryCell(faceI);
|
||||
|
||||
if (!mesh().pointInCell(sample, cellI, searchEngine_.decompMode()))
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Found cell " << cellI << " using face " << faceI
|
||||
<< ". But cell does not contain point " << sample
|
||||
<< abort(FatalError);
|
||||
}
|
||||
return cellI;
|
||||
return mesh().faceOwner()[faceI];
|
||||
}
|
||||
else
|
||||
{
|
||||
// Try owner and neighbour to see which one contains sample
|
||||
return mesh().faceNeighbour()[faceI];
|
||||
}
|
||||
}
|
||||
|
||||
label cellI = mesh().faceOwner()[faceI];
|
||||
|
||||
if (mesh().pointInCell(sample, cellI, searchEngine_.decompMode()))
|
||||
Foam::label Foam::sampledSet::pointInCell
|
||||
(
|
||||
const point& p,
|
||||
const label samplei
|
||||
) const
|
||||
{
|
||||
// Collect the face owner and neighbour cells of the sample into an array
|
||||
// for convenience
|
||||
label cells[4] =
|
||||
{
|
||||
mesh().faceOwner()[faces_[samplei]],
|
||||
getNeighbourCell(faces_[samplei]),
|
||||
mesh().faceOwner()[faces_[samplei+1]],
|
||||
getNeighbourCell(faces_[samplei+1])
|
||||
};
|
||||
|
||||
// Find the sampled cell by checking the owners and neighbours of the
|
||||
// sampled faces
|
||||
label cellm =
|
||||
(cells[0] == cells[2] || cells[0] == cells[3]) ? cells[0]
|
||||
: (cells[1] == cells[2] || cells[1] == cells[3]) ? cells[1]
|
||||
: -1;
|
||||
|
||||
if (cellm != -1)
|
||||
{
|
||||
// If found the sampled cell check the point is in the cell
|
||||
// otherwise ignore
|
||||
if (!mesh().pointInCell(p, cellm, searchEngine_.decompMode()))
|
||||
{
|
||||
return cellI;
|
||||
}
|
||||
else
|
||||
{
|
||||
cellI = mesh().faceNeighbour()[faceI];
|
||||
cellm = -1;
|
||||
|
||||
if (mesh().pointInCell(sample, cellI, searchEngine_.decompMode()))
|
||||
if (debug)
|
||||
{
|
||||
return cellI;
|
||||
}
|
||||
else
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "None of the neighbours of face "
|
||||
<< faceI << " contains point " << sample
|
||||
<< abort(FatalError);
|
||||
|
||||
return -1;
|
||||
WarningInFunction
|
||||
<< "Could not find mid-point " << p
|
||||
<< " cell " << cellm << endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// If the sample does not pass through a single cell check if the point
|
||||
// is in any of the owners or neighbours otherwise ignore
|
||||
for (label i=0; i<4; i++)
|
||||
{
|
||||
if (mesh().pointInCell(p, cells[i], searchEngine_.decompMode()))
|
||||
{
|
||||
return cells[i];
|
||||
}
|
||||
}
|
||||
|
||||
if (debug)
|
||||
{
|
||||
WarningInFunction
|
||||
<< "Could not find cell for mid-point" << nl
|
||||
<< " samplei: " << samplei
|
||||
<< " pts[samplei]: " << operator[](samplei)
|
||||
<< " face[samplei]: " << faces_[samplei]
|
||||
<< " pts[samplei+1]: " << operator[](samplei+1)
|
||||
<< " face[samplei+1]: " << faces_[samplei+1]
|
||||
<< " cellio: " << cells[0]
|
||||
<< " cellin: " << cells[1]
|
||||
<< " celljo: " << cells[2]
|
||||
<< " celljn: " << cells[3]
|
||||
<< endl;
|
||||
}
|
||||
}
|
||||
|
||||
return cellm;
|
||||
}
|
||||
|
||||
|
||||
@ -119,7 +144,7 @@ Foam::scalar Foam::sampledSet::calcSign
|
||||
|
||||
if (magVec < VSMALL)
|
||||
{
|
||||
// sample on face centre. Regard as inside
|
||||
// Sample on face centre. Regard as inside
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -133,7 +158,6 @@ Foam::scalar Foam::sampledSet::calcSign
|
||||
}
|
||||
|
||||
|
||||
// Return face (or -1) of face which is within smallDist of sample
|
||||
Foam::label Foam::sampledSet::findNearFace
|
||||
(
|
||||
const label cellI,
|
||||
@ -169,8 +193,6 @@ Foam::label Foam::sampledSet::findNearFace
|
||||
}
|
||||
|
||||
|
||||
// 'Pushes' point facePt (which is almost on face) in direction of cell centre
|
||||
// so it is clearly inside.
|
||||
Foam::point Foam::sampledSet::pushIn
|
||||
(
|
||||
const point& facePt,
|
||||
@ -224,30 +246,22 @@ Foam::point Foam::sampledSet::pushIn
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
//Info<< "pushIn : moved " << facePt << " to " << newPosition
|
||||
// << endl;
|
||||
|
||||
return newPosition;
|
||||
}
|
||||
|
||||
|
||||
// Calculates start of tracking given samplePt and first boundary intersection
|
||||
// (bPoint, bFaceI). bFaceI == -1 if no boundary intersection.
|
||||
// Returns true if trackPt is sampling point
|
||||
bool Foam::sampledSet::getTrackingPoint
|
||||
(
|
||||
const vector& offset,
|
||||
const point& samplePt,
|
||||
const point& bPoint,
|
||||
const label bFaceI,
|
||||
const scalar smallDist,
|
||||
|
||||
point& trackPt,
|
||||
label& trackCellI,
|
||||
label& trackFaceI
|
||||
) const
|
||||
{
|
||||
const scalar smallDist = mag(tol*offset);
|
||||
|
||||
bool isGoodSample = false;
|
||||
|
||||
if (bFaceI == -1)
|
||||
@ -268,9 +282,6 @@ bool Foam::sampledSet::getTrackingPoint
|
||||
{
|
||||
// Line samplePt - end_ does not intersect domain at all.
|
||||
// (or is along edge)
|
||||
//Info<< "getTrackingPoint : samplePt outside domain : "
|
||||
// << " samplePt:" << samplePt
|
||||
// << endl;
|
||||
|
||||
trackCellI = -1;
|
||||
trackFaceI = -1;
|
||||
@ -279,11 +290,7 @@ bool Foam::sampledSet::getTrackingPoint
|
||||
}
|
||||
else
|
||||
{
|
||||
// start is inside. Use it as tracking point
|
||||
//Info<< "getTrackingPoint : samplePt inside :"
|
||||
// << " samplePt:" << samplePt
|
||||
// << " trackCellI:" << trackCellI
|
||||
// << endl;
|
||||
// Start is inside. Use it as tracking point
|
||||
|
||||
trackPt = samplePt;
|
||||
trackFaceI = -1;
|
||||
@ -293,10 +300,6 @@ bool Foam::sampledSet::getTrackingPoint
|
||||
}
|
||||
else if (mag(samplePt - bPoint) < smallDist)
|
||||
{
|
||||
//Info<< "getTrackingPoint : samplePt:" << samplePt
|
||||
// << " close to bPoint:"
|
||||
// << bPoint << endl;
|
||||
|
||||
// samplePt close to bPoint. Snap to it
|
||||
trackPt = pushIn(bPoint, bFaceI);
|
||||
trackFaceI = bFaceI;
|
||||
@ -330,8 +333,7 @@ bool Foam::sampledSet::getTrackingPoint
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Info<< "sampledSet::getTrackingPoint :"
|
||||
<< " offset:" << offset
|
||||
InfoInFunction
|
||||
<< " samplePt:" << samplePt
|
||||
<< " bPoint:" << bPoint
|
||||
<< " bFaceI:" << bFaceI
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -92,12 +92,12 @@ protected:
|
||||
//- Returns cell next to boundary face
|
||||
label getBoundaryCell(const label) const;
|
||||
|
||||
//- Returns cell using face and containing sample
|
||||
label getCell
|
||||
(
|
||||
const label faceI,
|
||||
const point& sample
|
||||
) const;
|
||||
//- Returns the neigbour cell or the owner if face in on the boundary
|
||||
label getNeighbourCell(const label) const;
|
||||
|
||||
//- Return the cell in which the point on the sample line
|
||||
// resides if found otherwise return -1
|
||||
label pointInCell(const point& p, const label samplei) const;
|
||||
|
||||
//- Calculates inproduct of face normal and vector sample-face centre
|
||||
// <0 if sample inside.
|
||||
@ -125,10 +125,10 @@ protected:
|
||||
// trackFaceI, trackCellI (-1 if no tracking point found)
|
||||
bool getTrackingPoint
|
||||
(
|
||||
const vector& offset,
|
||||
const point& samplePt,
|
||||
const point& bPoint,
|
||||
const label bFaceI,
|
||||
const scalar smallDist,
|
||||
|
||||
point& trackPt,
|
||||
label& trackCellI,
|
||||
@ -193,13 +193,6 @@ public:
|
||||
};
|
||||
|
||||
|
||||
// Static data
|
||||
|
||||
//- Tolerance when comparing points. Usually relative to difference
|
||||
// between start_ and end_
|
||||
static const scalar tol;
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -63,7 +63,7 @@ void Foam::sampledSets::combineSampledSets
|
||||
const sampledSet& samplePts = sampledSets[setI];
|
||||
|
||||
// Collect data from all processors
|
||||
List<List<point> > gatheredPts(Pstream::nProcs());
|
||||
List<List<point>> gatheredPts(Pstream::nProcs());
|
||||
gatheredPts[Pstream::myProcNo()] = samplePts;
|
||||
Pstream::gatherList(gatheredPts);
|
||||
|
||||
@ -79,9 +79,9 @@ void Foam::sampledSets::combineSampledSets
|
||||
// Combine processor lists into one big list.
|
||||
List<point> allPts
|
||||
(
|
||||
ListListOps::combine<List<point> >
|
||||
ListListOps::combine<List<point>>
|
||||
(
|
||||
gatheredPts, accessOp<List<point> >()
|
||||
gatheredPts, accessOp<List<point>>()
|
||||
)
|
||||
);
|
||||
labelList allSegments
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -74,7 +74,7 @@ class sampledSets
|
||||
public:
|
||||
|
||||
//- The set formatter
|
||||
autoPtr< writer<Type> > formatter;
|
||||
autoPtr<writer<Type>> formatter;
|
||||
|
||||
//- Construct null
|
||||
fieldGroup()
|
||||
@ -110,7 +110,7 @@ class sampledSets
|
||||
template<class Type>
|
||||
class volFieldSampler
|
||||
:
|
||||
public List<Field<Type> >
|
||||
public List<Field<Type>>
|
||||
{
|
||||
//- Name of this collection of values
|
||||
const word name_;
|
||||
@ -135,7 +135,7 @@ class sampledSets
|
||||
//- Construct from components
|
||||
volFieldSampler
|
||||
(
|
||||
const List<Field<Type> >& values,
|
||||
const List<Field<Type>>& values,
|
||||
const word& name
|
||||
);
|
||||
|
||||
@ -222,16 +222,16 @@ class sampledSets
|
||||
template<class T>
|
||||
void combineSampledValues
|
||||
(
|
||||
const PtrList<volFieldSampler<T> >& sampledFields,
|
||||
const PtrList<volFieldSampler<T>>& sampledFields,
|
||||
const labelListList& indexSets,
|
||||
PtrList<volFieldSampler<T> >& masterFields
|
||||
PtrList<volFieldSampler<T>>& masterFields
|
||||
);
|
||||
|
||||
template<class Type>
|
||||
void writeSampleFile
|
||||
(
|
||||
const coordSet& masterSampleSet,
|
||||
const PtrList<volFieldSampler<Type> >& masterFields,
|
||||
const PtrList<volFieldSampler<Type>>& masterFields,
|
||||
const label setI,
|
||||
const fileName& timeDir,
|
||||
const writer<Type>& formatter
|
||||
@ -310,7 +310,7 @@ public:
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
# include "sampledSetsTemplates.C"
|
||||
#include "sampledSetsTemplates.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -37,10 +37,10 @@ Foam::sampledSets::volFieldSampler<Type>::volFieldSampler
|
||||
const PtrList<sampledSet>& samplers
|
||||
)
|
||||
:
|
||||
List<Field<Type> >(samplers.size()),
|
||||
List<Field<Type>>(samplers.size()),
|
||||
name_(field.name())
|
||||
{
|
||||
autoPtr<interpolation<Type> > interpolator
|
||||
autoPtr<interpolation<Type>> interpolator
|
||||
(
|
||||
interpolation<Type>::New(interpolationScheme, field)
|
||||
);
|
||||
@ -83,7 +83,7 @@ Foam::sampledSets::volFieldSampler<Type>::volFieldSampler
|
||||
const PtrList<sampledSet>& samplers
|
||||
)
|
||||
:
|
||||
List<Field<Type> >(samplers.size()),
|
||||
List<Field<Type>>(samplers.size()),
|
||||
name_(field.name())
|
||||
{
|
||||
forAll(samplers, setI)
|
||||
@ -112,11 +112,11 @@ Foam::sampledSets::volFieldSampler<Type>::volFieldSampler
|
||||
template<class Type>
|
||||
Foam::sampledSets::volFieldSampler<Type>::volFieldSampler
|
||||
(
|
||||
const List<Field<Type> >& values,
|
||||
const List<Field<Type>>& values,
|
||||
const word& name
|
||||
)
|
||||
:
|
||||
List<Field<Type> >(values),
|
||||
List<Field<Type>>(values),
|
||||
name_(name)
|
||||
{}
|
||||
|
||||
@ -125,7 +125,7 @@ template<class Type>
|
||||
void Foam::sampledSets::writeSampleFile
|
||||
(
|
||||
const coordSet& masterSampleSet,
|
||||
const PtrList<volFieldSampler<Type> >& masterFields,
|
||||
const PtrList<volFieldSampler<Type>>& masterFields,
|
||||
const label setI,
|
||||
const fileName& timeDir,
|
||||
const writer<Type>& formatter
|
||||
@ -176,19 +176,19 @@ void Foam::sampledSets::writeSampleFile
|
||||
template<class T>
|
||||
void Foam::sampledSets::combineSampledValues
|
||||
(
|
||||
const PtrList<volFieldSampler<T> >& sampledFields,
|
||||
const PtrList<volFieldSampler<T>>& sampledFields,
|
||||
const labelListList& indexSets,
|
||||
PtrList<volFieldSampler<T> >& masterFields
|
||||
PtrList<volFieldSampler<T>>& masterFields
|
||||
)
|
||||
{
|
||||
forAll(sampledFields, fieldi)
|
||||
{
|
||||
List<Field<T> > masterValues(indexSets.size());
|
||||
List<Field<T>> masterValues(indexSets.size());
|
||||
|
||||
forAll(indexSets, setI)
|
||||
{
|
||||
// Collect data from all processors
|
||||
List<Field<T> > gatheredData(Pstream::nProcs());
|
||||
List<Field<T>> gatheredData(Pstream::nProcs());
|
||||
gatheredData[Pstream::myProcNo()] = sampledFields[fieldi][setI];
|
||||
Pstream::gatherList(gatheredData);
|
||||
|
||||
@ -196,10 +196,10 @@ void Foam::sampledSets::combineSampledValues
|
||||
{
|
||||
Field<T> allData
|
||||
(
|
||||
ListListOps::combine<Field<T> >
|
||||
ListListOps::combine<Field<T>>
|
||||
(
|
||||
gatheredData,
|
||||
Foam::accessOp<Field<T> >()
|
||||
Foam::accessOp<Field<T>>()
|
||||
)
|
||||
);
|
||||
|
||||
@ -238,7 +238,7 @@ void Foam::sampledSets::sampleAndWrite(fieldGroup<Type>& fields)
|
||||
}
|
||||
|
||||
// Storage for interpolated values
|
||||
PtrList<volFieldSampler<Type> > sampledFields(fields.size());
|
||||
PtrList<volFieldSampler<Type>> sampledFields(fields.size());
|
||||
|
||||
forAll(fields, fieldi)
|
||||
{
|
||||
@ -297,7 +297,7 @@ void Foam::sampledSets::sampleAndWrite(fieldGroup<Type>& fields)
|
||||
(
|
||||
interpolationScheme_,
|
||||
mesh_.lookupObject
|
||||
<GeometricField<Type, fvPatchField, volMesh> >
|
||||
<GeometricField<Type, fvPatchField, volMesh>>
|
||||
(fields[fieldi]),
|
||||
*this
|
||||
)
|
||||
@ -311,7 +311,7 @@ void Foam::sampledSets::sampleAndWrite(fieldGroup<Type>& fields)
|
||||
new volFieldSampler<Type>
|
||||
(
|
||||
mesh_.lookupObject
|
||||
<GeometricField<Type, fvPatchField, volMesh> >
|
||||
<GeometricField<Type, fvPatchField, volMesh>>
|
||||
(fields[fieldi]),
|
||||
*this
|
||||
)
|
||||
@ -323,7 +323,7 @@ void Foam::sampledSets::sampleAndWrite(fieldGroup<Type>& fields)
|
||||
// Combine sampled fields from processors.
|
||||
// Note: only master results are valid
|
||||
|
||||
PtrList<volFieldSampler<Type> > masterFields(sampledFields.size());
|
||||
PtrList<volFieldSampler<Type>> masterFields(sampledFields.size());
|
||||
combineSampledValues(sampledFields, indexSets_, masterFields);
|
||||
|
||||
if (Pstream::master())
|
||||
|
||||
@ -0,0 +1,34 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: dev |
|
||||
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
functions
|
||||
{
|
||||
// Example of sampling on a line
|
||||
lines
|
||||
{
|
||||
type sets;
|
||||
|
||||
functionObjectLibs ("libsampling.so");
|
||||
|
||||
outputControl outputTime;
|
||||
setFormat gnuplot;
|
||||
fields (p U);
|
||||
interpolationScheme cellPoint;
|
||||
sets
|
||||
(
|
||||
diagonal
|
||||
{
|
||||
type midPoint;
|
||||
|
||||
axis x;
|
||||
start (-0.0206 -0.0254 -0.0005);
|
||||
end (0.29 0.0254 0.0005);
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -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-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -169,7 +169,7 @@ Foam::point Foam::triSurfaceMeshPointSet::getRefPoint(const List<point>& pts)
|
||||
}
|
||||
else
|
||||
{
|
||||
return vector::zero;
|
||||
return Zero;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -36,6 +36,8 @@ namespace Foam
|
||||
{
|
||||
defineTypeNameAndDebug(uniformSet, 0);
|
||||
addToRunTimeSelectionTable(sampledSet, uniformSet, word);
|
||||
|
||||
const scalar uniformSet::tol = 1e-3;
|
||||
}
|
||||
|
||||
|
||||
@ -260,10 +262,10 @@ void Foam::uniformSet::calcSamples
|
||||
bool isSample =
|
||||
getTrackingPoint
|
||||
(
|
||||
offset,
|
||||
start_,
|
||||
bPoint,
|
||||
bFaceI,
|
||||
smallDist,
|
||||
|
||||
trackPt,
|
||||
trackCellI,
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -112,6 +112,14 @@ public:
|
||||
//- Runtime type information
|
||||
TypeName("uniform");
|
||||
|
||||
|
||||
// Static data
|
||||
|
||||
//- Tolerance when comparing points relative to difference between
|
||||
// start_ and end_
|
||||
static const scalar tol;
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -108,14 +108,14 @@ class distanceSurface
|
||||
|
||||
//- Sample field on faces
|
||||
template<class Type>
|
||||
tmp<Field<Type> > sampleField
|
||||
tmp<Field<Type>> sampleField
|
||||
(
|
||||
const GeometricField<Type, fvPatchField, volMesh>& vField
|
||||
) const;
|
||||
|
||||
|
||||
template<class Type>
|
||||
tmp<Field<Type> >
|
||||
tmp<Field<Type>>
|
||||
interpolateField(const interpolation<Type>&) const;
|
||||
|
||||
|
||||
@ -278,7 +278,7 @@ public:
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
# include "distanceSurfaceTemplates.C"
|
||||
#include "distanceSurfaceTemplates.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -31,7 +31,7 @@ License
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
Foam::tmp<Foam::Field<Type> >
|
||||
Foam::tmp<Foam::Field<Type>>
|
||||
Foam::distanceSurface::sampleField
|
||||
(
|
||||
const GeometricField<Type, fvPatchField, volMesh>& vField
|
||||
@ -39,14 +39,14 @@ Foam::distanceSurface::sampleField
|
||||
{
|
||||
if (cell_)
|
||||
{
|
||||
return tmp<Field<Type> >
|
||||
return tmp<Field<Type>>
|
||||
(
|
||||
new Field<Type>(vField, isoSurfCellPtr_().meshCells())
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
return tmp<Field<Type> >
|
||||
return tmp<Field<Type>>
|
||||
(
|
||||
new Field<Type>(vField, isoSurfPtr_().meshCells())
|
||||
);
|
||||
@ -55,7 +55,7 @@ Foam::distanceSurface::sampleField
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::tmp<Foam::Field<Type> >
|
||||
Foam::tmp<Foam::Field<Type>>
|
||||
Foam::distanceSurface::interpolateField
|
||||
(
|
||||
const interpolation<Type>& interpolator
|
||||
@ -67,7 +67,7 @@ Foam::distanceSurface::interpolateField
|
||||
const GeometricField<Type, fvPatchField, volMesh>& volFld =
|
||||
interpolator.psi();
|
||||
|
||||
tmp<GeometricField<Type, pointPatchField, pointMesh> > pointFld
|
||||
tmp<GeometricField<Type, pointPatchField, pointMesh>> pointFld
|
||||
(
|
||||
volPointInterpolation::New(fvm).interpolate(volFld)
|
||||
);
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -43,25 +43,24 @@ License
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
defineTypeNameAndDebug(isoSurface, 0);
|
||||
defineTypeNameAndDebug(isoSurface, 0);
|
||||
|
||||
// Helper class for slicing triangles
|
||||
class storeOp
|
||||
{
|
||||
public:
|
||||
DynamicList<triPoints>& tris_;
|
||||
|
||||
inline storeOp(DynamicList<triPoints>& tris)
|
||||
:
|
||||
tris_(tris)
|
||||
{}
|
||||
|
||||
inline void operator()(const triPoints& tri)
|
||||
// Helper class for slicing triangles
|
||||
class storeOp
|
||||
{
|
||||
tris_.append(tri);
|
||||
}
|
||||
};
|
||||
public:
|
||||
DynamicList<triPoints>& tris_;
|
||||
|
||||
inline storeOp(DynamicList<triPoints>& tris)
|
||||
:
|
||||
tris_(tris)
|
||||
{}
|
||||
|
||||
inline void operator()(const triPoints& tri)
|
||||
{
|
||||
tris_.append(tri);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@ -82,7 +81,6 @@ bool Foam::isoSurface::noTransform(const tensor& tt) const
|
||||
}
|
||||
|
||||
|
||||
// Calculates per face whether couple is collocated.
|
||||
bool Foam::isoSurface::collocatedPatch(const polyPatch& pp)
|
||||
{
|
||||
const coupledPolyPatch& cpp = refCast<const coupledPolyPatch>(pp);
|
||||
@ -90,7 +88,6 @@ bool Foam::isoSurface::collocatedPatch(const polyPatch& pp)
|
||||
}
|
||||
|
||||
|
||||
// Calculates per face whether couple is collocated.
|
||||
Foam::PackedBoolList Foam::isoSurface::collocatedFaces
|
||||
(
|
||||
const coupledPolyPatch& pp
|
||||
@ -321,7 +318,6 @@ bool Foam::isoSurface::isEdgeOfFaceCut
|
||||
}
|
||||
|
||||
|
||||
// Get neighbour value and position.
|
||||
void Foam::isoSurface::getNeighbour
|
||||
(
|
||||
const labelList& boundaryRegion,
|
||||
@ -355,7 +351,6 @@ void Foam::isoSurface::getNeighbour
|
||||
}
|
||||
|
||||
|
||||
// Determine for every face/cell whether it (possibly) generates triangles.
|
||||
void Foam::isoSurface::calcCutTypes
|
||||
(
|
||||
const labelList& boundaryRegion,
|
||||
@ -495,10 +490,9 @@ void Foam::isoSurface::calcCutTypes
|
||||
}
|
||||
|
||||
|
||||
// Caculate centre of surface.
|
||||
Foam::point Foam::isoSurface::calcCentre(const triSurface& s)
|
||||
{
|
||||
vector sum = vector::zero;
|
||||
vector sum = Zero;
|
||||
|
||||
forAll(s, i)
|
||||
{
|
||||
@ -508,8 +502,6 @@ Foam::point Foam::isoSurface::calcCentre(const triSurface& s)
|
||||
}
|
||||
|
||||
|
||||
// Determine per cell centre whether all the intersections get collapsed
|
||||
// to a single point
|
||||
void Foam::isoSurface::calcSnappedCc
|
||||
(
|
||||
const labelList& boundaryRegion,
|
||||
@ -540,7 +532,7 @@ void Foam::isoSurface::calcSnappedCc
|
||||
|
||||
localTriPoints.clear();
|
||||
label nOther = 0;
|
||||
point otherPointSum = vector::zero;
|
||||
point otherPointSum = Zero;
|
||||
|
||||
// Create points for all intersections close to cell centre
|
||||
// (i.e. from pyramid edges)
|
||||
@ -675,8 +667,6 @@ void Foam::isoSurface::calcSnappedCc
|
||||
}
|
||||
|
||||
|
||||
// Determine per meshpoint whether all the intersections get collapsed
|
||||
// to a single point
|
||||
void Foam::isoSurface::calcSnappedPoint
|
||||
(
|
||||
const PackedBoolList& isBoundaryPoint,
|
||||
@ -728,7 +718,7 @@ void Foam::isoSurface::calcSnappedPoint
|
||||
|
||||
localTriPoints.clear();
|
||||
label nOther = 0;
|
||||
point otherPointSum = vector::zero;
|
||||
point otherPointSum = Zero;
|
||||
|
||||
forAll(pFaces, pFaceI)
|
||||
{
|
||||
@ -1265,7 +1255,6 @@ void Foam::isoSurface::trimToBox
|
||||
}
|
||||
|
||||
|
||||
// Does face use valid vertices?
|
||||
bool Foam::isoSurface::validTri(const triSurface& surf, const label faceI)
|
||||
{
|
||||
// Simple check on indices ok.
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -186,6 +186,7 @@ class isoSurface
|
||||
const bool neiLower
|
||||
) const;
|
||||
|
||||
//- Get neighbour value and position.
|
||||
void getNeighbour
|
||||
(
|
||||
const labelList& boundaryRegion,
|
||||
@ -197,7 +198,8 @@ class isoSurface
|
||||
point& nbrPoint
|
||||
) const;
|
||||
|
||||
//- Set faceCutType,cellCutType.
|
||||
//- Determine for every face/cell whether it (possibly) generates
|
||||
// triangles.
|
||||
void calcCutTypes
|
||||
(
|
||||
const labelList& boundaryRegion,
|
||||
@ -237,7 +239,7 @@ class isoSurface
|
||||
//- Return input field with coupled (and empty) patch values rewritten
|
||||
template<class Type>
|
||||
tmp<SlicedGeometricField
|
||||
<Type, fvPatchField, slicedFvPatchField, volMesh> >
|
||||
<Type, fvPatchField, slicedFvPatchField, volMesh>>
|
||||
adaptPatchFields
|
||||
(
|
||||
const GeometricField<Type, fvPatchField, volMesh>& fld
|
||||
@ -258,6 +260,9 @@ class isoSurface
|
||||
const Type& snapP1
|
||||
) const;
|
||||
|
||||
|
||||
//- Note: cannot use simpler isoSurfaceCell::generateTriPoints since
|
||||
// the need here to sometimes pass in remote 'snappedPoints'
|
||||
template<class Type>
|
||||
void generateTriPoints
|
||||
(
|
||||
@ -420,7 +425,7 @@ public:
|
||||
//- Interpolates cCoords,pCoords. Uses the references to the original
|
||||
// fields used to create the iso surface.
|
||||
template<class Type>
|
||||
tmp<Field<Type> > interpolate
|
||||
tmp<Field<Type>> interpolate
|
||||
(
|
||||
const GeometricField<Type, fvPatchField, volMesh>& cCoords,
|
||||
const Field<Type>& pCoords
|
||||
@ -436,7 +441,7 @@ public:
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
# include "isoSurfaceTemplates.C"
|
||||
#include "isoSurfaceTemplates.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -38,7 +38,7 @@ License
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
defineTypeNameAndDebug(isoSurfaceCell, 0);
|
||||
defineTypeNameAndDebug(isoSurfaceCell, 0);
|
||||
}
|
||||
|
||||
|
||||
@ -215,8 +215,6 @@ void Foam::isoSurfaceCell::calcCutTypes
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Return the two common points between two triangles
|
||||
Foam::labelPair Foam::isoSurfaceCell::findCommonPoints
|
||||
(
|
||||
const labelledTri& tri0,
|
||||
@ -253,10 +251,9 @@ Foam::labelPair Foam::isoSurfaceCell::findCommonPoints
|
||||
}
|
||||
|
||||
|
||||
// Caculate centre of surface.
|
||||
Foam::point Foam::isoSurfaceCell::calcCentre(const triSurface& s)
|
||||
{
|
||||
vector sum = vector::zero;
|
||||
vector sum = Zero;
|
||||
|
||||
forAll(s, i)
|
||||
{
|
||||
@ -266,8 +263,6 @@ Foam::point Foam::isoSurfaceCell::calcCentre(const triSurface& s)
|
||||
}
|
||||
|
||||
|
||||
// Replace surface (localPoints, localTris) with single point. Returns
|
||||
// point. Destructs arguments.
|
||||
Foam::pointIndexHit Foam::isoSurfaceCell::collapseSurface
|
||||
(
|
||||
const label cellI,
|
||||
@ -275,7 +270,7 @@ Foam::pointIndexHit Foam::isoSurfaceCell::collapseSurface
|
||||
DynamicList<labelledTri, 64>& localTris
|
||||
) const
|
||||
{
|
||||
pointIndexHit info(false, vector::zero, localTris.size());
|
||||
pointIndexHit info(false, Zero, localTris.size());
|
||||
|
||||
if (localTris.size() == 1)
|
||||
{
|
||||
@ -535,7 +530,6 @@ void Foam::isoSurfaceCell::calcSnappedCc
|
||||
}
|
||||
|
||||
|
||||
// Generate triangles for face connected to pointI
|
||||
void Foam::isoSurfaceCell::genPointTris
|
||||
(
|
||||
const scalarField& cellValues,
|
||||
@ -608,7 +602,6 @@ void Foam::isoSurfaceCell::genPointTris
|
||||
}
|
||||
|
||||
|
||||
// Generate triangle for tet connected to pointI
|
||||
void Foam::isoSurfaceCell::genPointTris
|
||||
(
|
||||
const scalarField& pointValues,
|
||||
@ -1056,7 +1049,6 @@ Foam::triSurface Foam::isoSurfaceCell::stitchTriPoints
|
||||
}
|
||||
|
||||
|
||||
// Does face use valid vertices?
|
||||
bool Foam::isoSurfaceCell::validTri(const triSurface& surf, const label faceI)
|
||||
{
|
||||
// Simple check on indices ok.
|
||||
@ -1127,7 +1119,7 @@ bool Foam::isoSurfaceCell::validTri(const triSurface& surf, const label faceI)
|
||||
void Foam::isoSurfaceCell::calcAddressing
|
||||
(
|
||||
const triSurface& surf,
|
||||
List<FixedList<label, 3> >& faceEdges,
|
||||
List<FixedList<label, 3>>& faceEdges,
|
||||
labelList& edgeFace0,
|
||||
labelList& edgeFace1,
|
||||
Map<labelList>& edgeFacesRest
|
||||
@ -1225,7 +1217,6 @@ void Foam::isoSurfaceCell::calcAddressing
|
||||
}
|
||||
|
||||
|
||||
// Checks if triangle is connected through edgeI only.
|
||||
bool Foam::isoSurfaceCell::danglingTriangle
|
||||
(
|
||||
const FixedList<label, 3>& fEdges,
|
||||
@ -1252,10 +1243,9 @@ bool Foam::isoSurfaceCell::danglingTriangle
|
||||
}
|
||||
|
||||
|
||||
// Mark triangles to keep. Returns number of dangling triangles.
|
||||
Foam::label Foam::isoSurfaceCell::markDanglingTriangles
|
||||
(
|
||||
const List<FixedList<label, 3> >& faceEdges,
|
||||
const List<FixedList<label, 3>>& faceEdges,
|
||||
const labelList& edgeFace0,
|
||||
const labelList& edgeFace1,
|
||||
const Map<labelList>& edgeFacesRest,
|
||||
@ -1523,7 +1513,6 @@ Foam::isoSurfaceCell::isoSurfaceCell
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Merge points and compact out non-valid triangles
|
||||
labelList triMap;
|
||||
triSurface::operator=
|
||||
@ -1588,7 +1577,7 @@ Foam::isoSurfaceCell::isoSurfaceCell
|
||||
|
||||
if (regularise)
|
||||
{
|
||||
List<FixedList<label, 3> > faceEdges;
|
||||
List<FixedList<label, 3>> faceEdges;
|
||||
labelList edgeFace0, edgeFace1;
|
||||
Map<labelList> edgeFacesRest;
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -153,14 +153,18 @@ class isoSurfaceCell
|
||||
const scalarField& pointValues
|
||||
);
|
||||
|
||||
//- Return the two common points between two triangles
|
||||
static labelPair findCommonPoints
|
||||
(
|
||||
const labelledTri&,
|
||||
const labelledTri&
|
||||
);
|
||||
|
||||
//- Caculate centre of surface.
|
||||
static point calcCentre(const triSurface&);
|
||||
|
||||
//- Replace surface (localPoints, localTris) with single point.
|
||||
// Returns point. Destroys arguments.
|
||||
pointIndexHit collapseSurface
|
||||
(
|
||||
const label cellI,
|
||||
@ -275,7 +279,7 @@ class isoSurfaceCell
|
||||
void calcAddressing
|
||||
(
|
||||
const triSurface& surf,
|
||||
List<FixedList<label, 3> >& faceEdges,
|
||||
List<FixedList<label, 3>>& faceEdges,
|
||||
labelList& edgeFace0,
|
||||
labelList& edgeFace1,
|
||||
Map<labelList>& edgeFacesRest
|
||||
@ -291,7 +295,7 @@ class isoSurfaceCell
|
||||
//- Mark all non-fully connected triangles
|
||||
static label markDanglingTriangles
|
||||
(
|
||||
const List<FixedList<label, 3> >& faceEdges,
|
||||
const List<FixedList<label, 3>>& faceEdges,
|
||||
const labelList& edgeFace0,
|
||||
const labelList& edgeFace1,
|
||||
const Map<labelList>& edgeFacesRest,
|
||||
@ -338,7 +342,7 @@ public:
|
||||
|
||||
//- Interpolates cCoords,pCoords.
|
||||
template<class Type>
|
||||
tmp<Field<Type> > interpolate
|
||||
tmp<Field<Type>> interpolate
|
||||
(
|
||||
const Field<Type>& cCoords,
|
||||
const Field<Type>& pCoords
|
||||
@ -353,7 +357,7 @@ public:
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
# include "isoSurfaceCellTemplates.C"
|
||||
#include "isoSurfaceCellTemplates.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -33,13 +33,16 @@ License
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
Foam::tmp<Foam::SlicedGeometricField
|
||||
Foam::tmp
|
||||
<
|
||||
Type,
|
||||
Foam::fvPatchField,
|
||||
Foam::slicedFvPatchField,
|
||||
Foam::volMesh
|
||||
> >
|
||||
Foam::SlicedGeometricField
|
||||
<
|
||||
Type,
|
||||
Foam::fvPatchField,
|
||||
Foam::slicedFvPatchField,
|
||||
Foam::volMesh
|
||||
>
|
||||
>
|
||||
Foam::isoSurface::adaptPatchFields
|
||||
(
|
||||
const GeometricField<Type, fvPatchField, volMesh>& fld
|
||||
@ -70,7 +73,7 @@ Foam::isoSurface::adaptPatchFields
|
||||
true // preserveCouples
|
||||
)
|
||||
);
|
||||
FieldType& sliceFld = tsliceFld();
|
||||
FieldType& sliceFld = tsliceFld.ref();
|
||||
|
||||
const fvMesh& mesh = fld.mesh();
|
||||
|
||||
@ -125,7 +128,7 @@ Foam::isoSurface::adaptPatchFields
|
||||
|
||||
const scalarField& w = mesh.weights().boundaryField()[patchI];
|
||||
|
||||
tmp<Field<Type> > f =
|
||||
tmp<Field<Type>> f =
|
||||
w*pfld.patchInternalField()
|
||||
+ (1.0-w)*pfld.patchNeighbourField();
|
||||
|
||||
@ -235,7 +238,7 @@ void Foam::isoSurface::generateTriPoints
|
||||
triIndex |= 8;
|
||||
}
|
||||
|
||||
/* Form the vertices of the triangles for each case */
|
||||
// Form the vertices of the triangles for each case
|
||||
switch (triIndex)
|
||||
{
|
||||
case 0x00:
|
||||
@ -470,7 +473,7 @@ Foam::label Foam::isoSurface::generateFaceTriPoints
|
||||
(
|
||||
snappedPoint[pointI] != -1
|
||||
? snappedPoints[snappedPoint[pointI]]
|
||||
: pTraits<Type>::zero
|
||||
: Type(Zero)
|
||||
),
|
||||
|
||||
pVals[nextPointI],
|
||||
@ -479,7 +482,7 @@ Foam::label Foam::isoSurface::generateFaceTriPoints
|
||||
(
|
||||
snappedPoint[nextPointI] != -1
|
||||
? snappedPoints[snappedPoint[nextPointI]]
|
||||
: pTraits<Type>::zero
|
||||
: Type(Zero)
|
||||
),
|
||||
|
||||
cVals[own],
|
||||
@ -488,7 +491,7 @@ Foam::label Foam::isoSurface::generateFaceTriPoints
|
||||
(
|
||||
snappedCc[own] != -1
|
||||
? snappedPoints[snappedCc[own]]
|
||||
: pTraits<Type>::zero
|
||||
: Type(Zero)
|
||||
),
|
||||
|
||||
neiVal,
|
||||
@ -584,7 +587,7 @@ void Foam::isoSurface::generateTriPoints
|
||||
(
|
||||
snappedCc[nei[faceI]] != -1
|
||||
? snappedPoints[snappedCc[nei[faceI]]]
|
||||
: pTraits<Type>::zero
|
||||
: Type(Zero)
|
||||
),
|
||||
|
||||
triPoints,
|
||||
@ -596,7 +599,7 @@ void Foam::isoSurface::generateTriPoints
|
||||
|
||||
// Determine neighbouring snap status
|
||||
boolList neiSnapped(mesh_.nFaces()-mesh_.nInternalFaces(), false);
|
||||
List<Type> neiSnappedPoint(neiSnapped.size(), pTraits<Type>::zero);
|
||||
List<Type> neiSnappedPoint(neiSnapped.size(), Type(Zero));
|
||||
forAll(patches, patchI)
|
||||
{
|
||||
const polyPatch& pp = patches[patchI];
|
||||
@ -682,7 +685,7 @@ void Foam::isoSurface::generateTriPoints
|
||||
cVals.boundaryField()[patchI][i],
|
||||
cCoords.boundaryField()[patchI][i],
|
||||
false,
|
||||
pTraits<Type>::zero,
|
||||
Type(Zero),
|
||||
|
||||
triPoints,
|
||||
triMeshCells
|
||||
@ -715,7 +718,7 @@ void Foam::isoSurface::generateTriPoints
|
||||
cVals.boundaryField()[patchI][i],
|
||||
cCoords.boundaryField()[patchI][i],
|
||||
false, // fc not snapped
|
||||
pTraits<Type>::zero,
|
||||
Type(Zero),
|
||||
|
||||
triPoints,
|
||||
triMeshCells
|
||||
@ -731,14 +734,6 @@ void Foam::isoSurface::generateTriPoints
|
||||
}
|
||||
|
||||
|
||||
//template<class Type>
|
||||
//Foam::tmp<Foam::Field<Type> >
|
||||
//Foam::isoSurface::sample(const Field<Type>& vField) const
|
||||
//{
|
||||
// return tmp<Field<Type> >(new Field<Type>(vField, meshCells()));
|
||||
//}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::tmp<Foam::Field<Type> >
|
||||
Foam::isoSurface::interpolate
|
||||
@ -817,7 +812,7 @@ Foam::isoSurface::interpolate
|
||||
fvPatchField,
|
||||
slicedFvPatchField,
|
||||
volMesh
|
||||
> > c2(adaptPatchFields(cCoords));
|
||||
>> c2(adaptPatchFields(cCoords));
|
||||
|
||||
|
||||
DynamicList<Type> triPoints(3*nCutCells_);
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -56,8 +56,8 @@ void Foam::sampledIsoSurface::getIsoFields() const
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "sampledIsoSurface::getIsoFields() : lookup volField "
|
||||
<< isoField_ << endl;
|
||||
InfoInFunction
|
||||
<< "Lookup volField " << isoField_ << endl;
|
||||
}
|
||||
storedVolFieldPtr_.clear();
|
||||
volFieldPtr_ = &fvm.lookupObject<volScalarField>(isoField_);
|
||||
@ -68,8 +68,9 @@ void Foam::sampledIsoSurface::getIsoFields() const
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Info<< "sampledIsoSurface::getIsoFields() : checking "
|
||||
<< isoField_ << " for same time " << fvm.time().timeName()
|
||||
InfoInFunction
|
||||
<< "Checking " << isoField_
|
||||
<< " for same time " << fvm.time().timeName()
|
||||
<< endl;
|
||||
}
|
||||
|
||||
@ -81,8 +82,9 @@ void Foam::sampledIsoSurface::getIsoFields() const
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "sampledIsoSurface::getIsoFields() : reading volField "
|
||||
<< isoField_ << " from time " << fvm.time().timeName()
|
||||
InfoInFunction
|
||||
<< "Reading volField " << isoField_
|
||||
<< " from time " << fvm.time().timeName()
|
||||
<< endl;
|
||||
}
|
||||
|
||||
@ -111,9 +113,9 @@ void Foam::sampledIsoSurface::getIsoFields() const
|
||||
else
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Cannot find isosurface field " << isoField_
|
||||
<< " in database or directory " << vfHeader.path()
|
||||
<< exit(FatalError);
|
||||
<< "Cannot find isosurface field " << isoField_
|
||||
<< " in database or directory " << vfHeader.path()
|
||||
<< exit(FatalError);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -126,8 +128,7 @@ void Foam::sampledIsoSurface::getIsoFields() const
|
||||
// "volPointInterpolate(p)" so register it and re-use it. This is the
|
||||
// same as the 'cache' functionality from volPointInterpolate but
|
||||
// unfortunately that one does not guarantee that the field pointer
|
||||
// remain: e.g. some other
|
||||
// functionObject might delete the cached version.
|
||||
// remain: e.g. some other functionObject might delete the cached version.
|
||||
// (volPointInterpolation::interpolate with cache=false deletes any
|
||||
// registered one or if mesh.changing())
|
||||
|
||||
@ -144,8 +145,8 @@ void Foam::sampledIsoSurface::getIsoFields() const
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "sampledIsoSurface::getIsoFields() :"
|
||||
<< " lookup pointField " << pointFldName << endl;
|
||||
InfoInFunction
|
||||
<< "lookup pointField " << pointFldName << endl;
|
||||
}
|
||||
const pointScalarField& pfld = fvm.lookupObject<pointScalarField>
|
||||
(
|
||||
@ -156,8 +157,9 @@ void Foam::sampledIsoSurface::getIsoFields() const
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "sampledIsoSurface::getIsoFields() :"
|
||||
<< " updating pointField " << pointFldName << endl;
|
||||
InfoInFunction
|
||||
<< "updating pointField "
|
||||
<< pointFldName << endl;
|
||||
}
|
||||
// Update the interpolated value
|
||||
volPointInterpolation::New(fvm).interpolate
|
||||
@ -175,12 +177,15 @@ void Foam::sampledIsoSurface::getIsoFields() const
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Info<< "sampledIsoSurface::getIsoFields() :"
|
||||
<< " creating and storing pointField "
|
||||
<< pointFldName << " for time "
|
||||
<< fvm.time().timeName() << endl;
|
||||
InfoInFunction
|
||||
<< "Checking pointField " << pointFldName
|
||||
<< " for same time " << fvm.time().timeName()
|
||||
<< endl;
|
||||
}
|
||||
|
||||
// Interpolate without cache. Note that we're registering it
|
||||
// below so next time round it goes into the condition
|
||||
// above.
|
||||
tmp<pointScalarField> tpfld
|
||||
(
|
||||
volPointInterpolation::New(fvm).interpolate
|
||||
@ -209,11 +214,12 @@ void Foam::sampledIsoSurface::getIsoFields() const
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Info<< "sampledIsoSurface::getIsoFields() : volField "
|
||||
<< volFieldPtr_->name() << " min:" << min(*volFieldPtr_).value()
|
||||
InfoInFunction
|
||||
<< "volField " << volFieldPtr_->name()
|
||||
<< " min:" << min(*volFieldPtr_).value()
|
||||
<< " max:" << max(*volFieldPtr_).value() << endl;
|
||||
Info<< "sampledIsoSurface::getIsoFields() : pointField "
|
||||
<< pointFieldPtr_->name()
|
||||
InfoInFunction
|
||||
<< "pointField " << pointFieldPtr_->name()
|
||||
<< " min:" << gMin(pointFieldPtr_->internalField())
|
||||
<< " max:" << gMax(pointFieldPtr_->internalField()) << endl;
|
||||
}
|
||||
@ -229,8 +235,8 @@ void Foam::sampledIsoSurface::getIsoFields() const
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "sampledIsoSurface::getIsoFields() :"
|
||||
<< " submesh lookup volField "
|
||||
InfoInFunction
|
||||
<< "Sub-mesh lookup volField "
|
||||
<< isoField_ << endl;
|
||||
}
|
||||
storedVolSubFieldPtr_.clear();
|
||||
@ -240,8 +246,8 @@ void Foam::sampledIsoSurface::getIsoFields() const
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "sampledIsoSurface::getIsoFields() : "
|
||||
<< "subsetting volField " << isoField_ << endl;
|
||||
InfoInFunction
|
||||
<< "Sub-setting volField " << isoField_ << endl;
|
||||
}
|
||||
storedVolSubFieldPtr_.reset
|
||||
(
|
||||
@ -268,8 +274,8 @@ void Foam::sampledIsoSurface::getIsoFields() const
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "sampledIsoSurface::getIsoFields() :"
|
||||
<< " submesh lookup pointField " << pointFldName << endl;
|
||||
InfoInFunction
|
||||
<< "Sub-mesh lookup pointField " << pointFldName << endl;
|
||||
}
|
||||
const pointScalarField& pfld = subFvm.lookupObject<pointScalarField>
|
||||
(
|
||||
@ -298,8 +304,8 @@ void Foam::sampledIsoSurface::getIsoFields() const
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "sampledIsoSurface::getIsoFields() :"
|
||||
<< " interpolating submesh volField "
|
||||
InfoInFunction
|
||||
<< "Interpolating submesh volField "
|
||||
<< volSubFieldPtr_->name()
|
||||
<< " to get submesh pointField " << pointFldName << endl;
|
||||
}
|
||||
@ -329,11 +335,13 @@ void Foam::sampledIsoSurface::getIsoFields() const
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Info<< "sampledIsoSurface::getIsoFields() : volSubField "
|
||||
InfoInFunction
|
||||
<< "volSubField "
|
||||
<< volSubFieldPtr_->name()
|
||||
<< " min:" << min(*volSubFieldPtr_).value()
|
||||
<< " max:" << max(*volSubFieldPtr_).value() << endl;
|
||||
Info<< "sampledIsoSurface::getIsoFields() : pointSubField "
|
||||
InfoInFunction
|
||||
<< "pointSubField "
|
||||
<< pointSubFieldPtr_->name()
|
||||
<< " min:" << gMin(pointSubFieldPtr_->internalField())
|
||||
<< " max:" << gMax(pointSubFieldPtr_->internalField()) << endl;
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -124,14 +124,14 @@ class sampledIsoSurface
|
||||
|
||||
//- Sample field on faces
|
||||
template<class Type>
|
||||
tmp<Field<Type> > sampleField
|
||||
tmp<Field<Type>> sampleField
|
||||
(
|
||||
const GeometricField<Type, fvPatchField, volMesh>& vField
|
||||
) const;
|
||||
|
||||
|
||||
template<class Type>
|
||||
tmp<Field<Type> >
|
||||
tmp<Field<Type>>
|
||||
interpolateField(const interpolation<Type>&) const;
|
||||
|
||||
|
||||
@ -277,7 +277,7 @@ public:
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
# include "sampledIsoSurfaceTemplates.C"
|
||||
#include "sampledIsoSurfaceTemplates.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -75,8 +75,7 @@ bool Foam::sampledIsoSurfaceCell::updateGeometry() const
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "sampledIsoSurfaceCell::updateGeometry() : lookup "
|
||||
<< isoField_ << endl;
|
||||
InfoInFunction << "Lookup " << isoField_ << endl;
|
||||
}
|
||||
|
||||
cellFldPtr = &fvm.lookupObject<volScalarField>(isoField_);
|
||||
@ -87,8 +86,9 @@ bool Foam::sampledIsoSurfaceCell::updateGeometry() const
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Info<< "sampledIsoSurfaceCell::updateGeometry() : reading "
|
||||
<< isoField_ << " from time " <<fvm.time().timeName()
|
||||
InfoInFunction
|
||||
<< "Reading " << isoField_
|
||||
<< " from time " <<fvm.time().timeName()
|
||||
<< endl;
|
||||
}
|
||||
|
||||
@ -216,15 +216,7 @@ Foam::sampledIsoSurfaceCell::sampledIsoSurfaceCell
|
||||
facesPtr_(NULL),
|
||||
prevTimeIndex_(-1),
|
||||
meshCells_(0)
|
||||
{
|
||||
// dict.readIfPresent("zone", zoneKey_);
|
||||
//
|
||||
// if (debug && zoneKey_.size() && mesh.cellZones().findZoneID(zoneKey_) < 0)
|
||||
// {
|
||||
// Info<< "cellZone " << zoneKey_
|
||||
// << " not found - using entire mesh" << endl;
|
||||
// }
|
||||
}
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -95,14 +95,14 @@ class sampledIsoSurfaceCell
|
||||
|
||||
//- Sample field on faces
|
||||
template<class Type>
|
||||
tmp<Field<Type> > sampleField
|
||||
tmp<Field<Type>> sampleField
|
||||
(
|
||||
const GeometricField<Type, fvPatchField, volMesh>& vField
|
||||
) const;
|
||||
|
||||
|
||||
template<class Type>
|
||||
tmp<Field<Type> >
|
||||
tmp<Field<Type>>
|
||||
interpolateField(const interpolation<Type>&) const;
|
||||
|
||||
|
||||
@ -239,7 +239,7 @@ public:
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
# include "sampledIsoSurfaceCellTemplates.C"
|
||||
#include "sampledIsoSurfaceCellTemplates.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -32,7 +32,7 @@ License
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
Foam::tmp<Foam::Field<Type> >
|
||||
Foam::tmp<Foam::Field<Type>>
|
||||
Foam::sampledIsoSurfaceCell::sampleField
|
||||
(
|
||||
const GeometricField<Type, fvPatchField, volMesh>& vField
|
||||
@ -41,12 +41,12 @@ Foam::sampledIsoSurfaceCell::sampleField
|
||||
// Recreate geometry if time has changed
|
||||
updateGeometry();
|
||||
|
||||
return tmp<Field<Type> >(new Field<Type>(vField, meshCells_));
|
||||
return tmp<Field<Type>>(new Field<Type>(vField, meshCells_));
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::tmp<Foam::Field<Type> >
|
||||
Foam::tmp<Foam::Field<Type>>
|
||||
Foam::sampledIsoSurfaceCell::interpolateField
|
||||
(
|
||||
const interpolation<Type>& interpolator
|
||||
@ -56,8 +56,8 @@ Foam::sampledIsoSurfaceCell::interpolateField
|
||||
updateGeometry();
|
||||
|
||||
// One value per point
|
||||
tmp<Field<Type> > tvalues(new Field<Type>(points().size()));
|
||||
Field<Type>& values = tvalues();
|
||||
tmp<Field<Type>> tvalues(new Field<Type>(points().size()));
|
||||
Field<Type>& values = tvalues.ref();
|
||||
|
||||
boolList pointDone(points().size(), false);
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -31,7 +31,7 @@ License
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
Foam::tmp<Foam::Field<Type> >
|
||||
Foam::tmp<Foam::Field<Type>>
|
||||
Foam::sampledIsoSurface::sampleField
|
||||
(
|
||||
const GeometricField<Type, fvPatchField, volMesh>& vField
|
||||
@ -40,12 +40,12 @@ Foam::sampledIsoSurface::sampleField
|
||||
// Recreate geometry if time has changed
|
||||
updateGeometry();
|
||||
|
||||
return tmp<Field<Type> >(new Field<Type>(vField, surface().meshCells()));
|
||||
return tmp<Field<Type>>(new Field<Type>(vField, surface().meshCells()));
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::tmp<Foam::Field<Type> >
|
||||
Foam::tmp<Foam::Field<Type>>
|
||||
Foam::sampledIsoSurface::interpolateField
|
||||
(
|
||||
const interpolation<Type>& interpolator
|
||||
@ -60,13 +60,13 @@ Foam::sampledIsoSurface::interpolateField
|
||||
|
||||
if (subMeshPtr_.valid())
|
||||
{
|
||||
tmp<GeometricField<Type, fvPatchField, volMesh> > tvolSubFld =
|
||||
tmp<GeometricField<Type, fvPatchField, volMesh>> tvolSubFld =
|
||||
subMeshPtr_().interpolate(volFld);
|
||||
|
||||
const GeometricField<Type, fvPatchField, volMesh>& volSubFld =
|
||||
tvolSubFld();
|
||||
|
||||
tmp<GeometricField<Type, pointPatchField, pointMesh> > tpointSubFld =
|
||||
tmp<GeometricField<Type, pointPatchField, pointMesh>> tpointSubFld =
|
||||
volPointInterpolation::New(volSubFld.mesh()).interpolate(volSubFld);
|
||||
|
||||
// Sample.
|
||||
@ -82,7 +82,7 @@ Foam::sampledIsoSurface::interpolateField
|
||||
}
|
||||
else
|
||||
{
|
||||
tmp<GeometricField<Type, pointPatchField, pointMesh> > tpointFld =
|
||||
tmp<GeometricField<Type, pointPatchField, pointMesh>> tpointFld =
|
||||
volPointInterpolation::New(volFld.mesh()).interpolate(volFld);
|
||||
|
||||
// Sample.
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -106,14 +106,14 @@ class sampledCuttingPlane
|
||||
|
||||
//- Sample field on faces
|
||||
template<class Type>
|
||||
tmp<Field<Type> > sampleField
|
||||
tmp<Field<Type>> sampleField
|
||||
(
|
||||
const GeometricField<Type, fvPatchField, volMesh>& vField
|
||||
) const;
|
||||
|
||||
|
||||
template<class Type>
|
||||
tmp<Field<Type> >
|
||||
tmp<Field<Type>>
|
||||
interpolateField(const interpolation<Type>&) const;
|
||||
|
||||
|
||||
@ -255,7 +255,7 @@ public:
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
# include "sampledCuttingPlaneTemplates.C"
|
||||
#include "sampledCuttingPlaneTemplates.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -31,18 +31,18 @@ License
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
Foam::tmp<Foam::Field<Type> >
|
||||
Foam::tmp<Foam::Field<Type>>
|
||||
Foam::sampledCuttingPlane::sampleField
|
||||
(
|
||||
const GeometricField<Type, fvPatchField, volMesh>& vField
|
||||
) const
|
||||
{
|
||||
return tmp<Field<Type> >(new Field<Type>(vField, surface().meshCells()));
|
||||
return tmp<Field<Type>>(new Field<Type>(vField, surface().meshCells()));
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::tmp<Foam::Field<Type> >
|
||||
Foam::tmp<Foam::Field<Type>>
|
||||
Foam::sampledCuttingPlane::interpolateField
|
||||
(
|
||||
const interpolation<Type>& interpolator
|
||||
@ -54,13 +54,13 @@ Foam::sampledCuttingPlane::interpolateField
|
||||
|
||||
if (subMeshPtr_.valid())
|
||||
{
|
||||
tmp<GeometricField<Type, fvPatchField, volMesh> > tvolSubFld =
|
||||
tmp<GeometricField<Type, fvPatchField, volMesh>> tvolSubFld =
|
||||
subMeshPtr_().interpolate(volFld);
|
||||
|
||||
const GeometricField<Type, fvPatchField, volMesh>& volSubFld =
|
||||
tvolSubFld();
|
||||
|
||||
tmp<GeometricField<Type, pointPatchField, pointMesh> > tpointSubFld =
|
||||
tmp<GeometricField<Type, pointPatchField, pointMesh>> tpointSubFld =
|
||||
volPointInterpolation::New(volSubFld.mesh()).interpolate(volSubFld);
|
||||
|
||||
// Sample.
|
||||
@ -76,7 +76,7 @@ Foam::sampledCuttingPlane::interpolateField
|
||||
}
|
||||
else
|
||||
{
|
||||
tmp<GeometricField<Type, pointPatchField, pointMesh> > tpointFld
|
||||
tmp<GeometricField<Type, pointPatchField, pointMesh>> tpointFld
|
||||
(
|
||||
volPointInterpolation::New(volFld.mesh()).interpolate(volFld)
|
||||
);
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -84,20 +84,20 @@ class sampledPatch
|
||||
|
||||
//- Sample field on faces
|
||||
template<class Type>
|
||||
tmp<Field<Type> > sampleField
|
||||
tmp<Field<Type>> sampleField
|
||||
(
|
||||
const GeometricField<Type, fvPatchField, volMesh>& vField
|
||||
) const;
|
||||
|
||||
//- Sample surface field on faces
|
||||
template<class Type>
|
||||
tmp<Field<Type> > sampleField
|
||||
tmp<Field<Type>> sampleField
|
||||
(
|
||||
const GeometricField<Type, fvsPatchField, surfaceMesh>& sField
|
||||
) const;
|
||||
|
||||
template<class Type>
|
||||
tmp<Field<Type> > interpolateField(const interpolation<Type>&) const;
|
||||
tmp<Field<Type>> interpolateField(const interpolation<Type>&) const;
|
||||
|
||||
//- Re-map action on triangulation or cleanup
|
||||
virtual void remapFaces(const labelUList& faceMap);
|
||||
@ -287,7 +287,7 @@ public:
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
# include "sampledPatchTemplates.C"
|
||||
#include "sampledPatchTemplates.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -28,15 +28,15 @@ License
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
Foam::tmp<Foam::Field<Type> >
|
||||
Foam::tmp<Foam::Field<Type>>
|
||||
Foam::sampledPatch::sampleField
|
||||
(
|
||||
const GeometricField<Type, fvPatchField, volMesh>& vField
|
||||
) const
|
||||
{
|
||||
// One value per face
|
||||
tmp<Field<Type> > tvalues(new Field<Type>(patchFaceLabels_.size()));
|
||||
Field<Type>& values = tvalues();
|
||||
tmp<Field<Type>> tvalues(new Field<Type>(patchFaceLabels_.size()));
|
||||
Field<Type>& values = tvalues.ref();
|
||||
forAll(patchFaceLabels_, i)
|
||||
{
|
||||
label patchI = patchIDs_[patchIndex_[i]];
|
||||
@ -49,15 +49,15 @@ Foam::sampledPatch::sampleField
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::tmp<Foam::Field<Type> >
|
||||
Foam::tmp<Foam::Field<Type>>
|
||||
Foam::sampledPatch::sampleField
|
||||
(
|
||||
const GeometricField<Type, fvsPatchField, surfaceMesh>& sField
|
||||
) const
|
||||
{
|
||||
// One value per face
|
||||
tmp<Field<Type> > tvalues(new Field<Type>(patchFaceLabels_.size()));
|
||||
Field<Type>& values = tvalues();
|
||||
tmp<Field<Type>> tvalues(new Field<Type>(patchFaceLabels_.size()));
|
||||
Field<Type>& values = tvalues.ref();
|
||||
|
||||
forAll(patchFaceLabels_, i)
|
||||
{
|
||||
@ -70,15 +70,15 @@ Foam::sampledPatch::sampleField
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::tmp<Foam::Field<Type> >
|
||||
Foam::tmp<Foam::Field<Type>>
|
||||
Foam::sampledPatch::interpolateField
|
||||
(
|
||||
const interpolation<Type>& interpolator
|
||||
) const
|
||||
{
|
||||
// One value per vertex
|
||||
tmp<Field<Type> > tvalues(new Field<Type>(points().size()));
|
||||
Field<Type>& values = tvalues();
|
||||
tmp<Field<Type>> tvalues(new Field<Type>(points().size()));
|
||||
Field<Type>& values = tvalues.ref();
|
||||
|
||||
const labelList& own = mesh().faceOwner();
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -66,13 +66,13 @@ class sampledPatchInternalField
|
||||
|
||||
//- Sample field on faces
|
||||
template<class Type>
|
||||
tmp<Field<Type> > sampleField
|
||||
tmp<Field<Type>> sampleField
|
||||
(
|
||||
const GeometricField<Type, fvPatchField, volMesh>& vField
|
||||
) const;
|
||||
|
||||
template<class Type>
|
||||
tmp<Field<Type> > interpolateField(const interpolation<Type>&) const;
|
||||
tmp<Field<Type>> interpolateField(const interpolation<Type>&) const;
|
||||
|
||||
|
||||
public:
|
||||
@ -176,7 +176,7 @@ public:
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
# include "sampledPatchInternalFieldTemplates.C"
|
||||
#include "sampledPatchInternalFieldTemplates.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -30,15 +30,15 @@ License
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
Foam::tmp<Foam::Field<Type> >
|
||||
Foam::tmp<Foam::Field<Type>>
|
||||
Foam::sampledPatchInternalField::sampleField
|
||||
(
|
||||
const GeometricField<Type, fvPatchField, volMesh>& vField
|
||||
) const
|
||||
{
|
||||
// One value per face
|
||||
tmp<Field<Type> > tvalues(new Field<Type>(patchFaceLabels().size()));
|
||||
Field<Type>& values = tvalues();
|
||||
tmp<Field<Type>> tvalues(new Field<Type>(patchFaceLabels().size()));
|
||||
Field<Type>& values = tvalues.ref();
|
||||
|
||||
forAll(patchStart(), i)
|
||||
{
|
||||
@ -65,7 +65,7 @@ Foam::sampledPatchInternalField::sampleField
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::tmp<Foam::Field<Type> >
|
||||
Foam::tmp<Foam::Field<Type>>
|
||||
Foam::sampledPatchInternalField::interpolateField
|
||||
(
|
||||
const interpolation<Type>& interpolator
|
||||
@ -109,7 +109,7 @@ Foam::sampledPatchInternalField::interpolateField
|
||||
|
||||
// Now patchVals holds the interpolated data in patch face order.
|
||||
// Collect.
|
||||
SubList<Type>(allPatchVals, patchVals.size(), sz).assign(patchVals);
|
||||
SubList<Type>(allPatchVals, patchVals.size(), sz) = patchVals;
|
||||
sz += patchVals.size();
|
||||
}
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -70,14 +70,14 @@ class sampledPlane
|
||||
|
||||
//- Sample field on faces
|
||||
template<class Type>
|
||||
tmp<Field<Type> > sampleField
|
||||
tmp<Field<Type>> sampleField
|
||||
(
|
||||
const GeometricField<Type, fvPatchField, volMesh>& vField
|
||||
) const;
|
||||
|
||||
|
||||
template<class Type>
|
||||
tmp<Field<Type> >
|
||||
tmp<Field<Type>>
|
||||
interpolateField(const interpolation<Type>&) const;
|
||||
|
||||
|
||||
@ -220,7 +220,7 @@ public:
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
# include "sampledPlaneTemplates.C"
|
||||
#include "sampledPlaneTemplates.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -28,26 +28,26 @@ License
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
Foam::tmp<Foam::Field<Type> >
|
||||
Foam::tmp<Foam::Field<Type>>
|
||||
Foam::sampledPlane::sampleField
|
||||
(
|
||||
const GeometricField<Type, fvPatchField, volMesh>& vField
|
||||
) const
|
||||
{
|
||||
return tmp<Field<Type> >(new Field<Type>(vField, meshCells()));
|
||||
return tmp<Field<Type>>(new Field<Type>(vField, meshCells()));
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::tmp<Foam::Field<Type> >
|
||||
Foam::tmp<Foam::Field<Type>>
|
||||
Foam::sampledPlane::interpolateField
|
||||
(
|
||||
const interpolation<Type>& interpolator
|
||||
) const
|
||||
{
|
||||
// One value per point
|
||||
tmp<Field<Type> > tvalues(new Field<Type>(points().size()));
|
||||
Field<Type>& values = tvalues();
|
||||
tmp<Field<Type>> tvalues(new Field<Type>(points().size()));
|
||||
Field<Type>& values = tvalues.ref();
|
||||
|
||||
boolList pointDone(points().size(), false);
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -287,11 +287,11 @@ Foam::tmp<Foam::tensorField> Foam::sampledSurface::sample
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::Field<Foam::scalar> >
|
||||
Foam::tmp<Foam::Field<Foam::scalar>>
|
||||
Foam::sampledSurface::project(const Field<scalar>& field) const
|
||||
{
|
||||
tmp<Field<scalar> > tRes(new Field<scalar>(faces().size()));
|
||||
Field<scalar>& res = tRes();
|
||||
tmp<Field<scalar>> tRes(new Field<scalar>(faces().size()));
|
||||
Field<scalar>& res = tRes.ref();
|
||||
|
||||
forAll(faces(), faceI)
|
||||
{
|
||||
@ -302,38 +302,38 @@ Foam::sampledSurface::project(const Field<scalar>& field) const
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::Field<Foam::scalar> >
|
||||
Foam::tmp<Foam::Field<Foam::scalar>>
|
||||
Foam::sampledSurface::project(const Field<vector>& field) const
|
||||
{
|
||||
tmp<Field<scalar> > tRes(new Field<scalar>(faces().size()));
|
||||
project(tRes(), field);
|
||||
tmp<Field<scalar>> tRes(new Field<scalar>(faces().size()));
|
||||
project(tRes.ref(), field);
|
||||
return tRes;
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::Field<Foam::vector> >
|
||||
Foam::tmp<Foam::Field<Foam::vector>>
|
||||
Foam::sampledSurface::project(const Field<sphericalTensor>& field) const
|
||||
{
|
||||
tmp<Field<vector> > tRes(new Field<vector>(faces().size()));
|
||||
project(tRes(), field);
|
||||
tmp<Field<vector>> tRes(new Field<vector>(faces().size()));
|
||||
project(tRes.ref(), field);
|
||||
return tRes;
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::Field<Foam::vector> >
|
||||
Foam::tmp<Foam::Field<Foam::vector>>
|
||||
Foam::sampledSurface::project(const Field<symmTensor>& field) const
|
||||
{
|
||||
tmp<Field<vector> > tRes(new Field<vector>(faces().size()));
|
||||
project(tRes(), field);
|
||||
tmp<Field<vector>> tRes(new Field<vector>(faces().size()));
|
||||
project(tRes.ref(), field);
|
||||
return tRes;
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::Field<Foam::vector> >
|
||||
Foam::tmp<Foam::Field<Foam::vector>>
|
||||
Foam::sampledSurface::project(const Field<tensor>& field) const
|
||||
{
|
||||
tmp<Field<vector> > tRes(new Field<vector>(faces().size()));
|
||||
project(tRes(), field);
|
||||
tmp<Field<vector>> tRes(new Field<vector>(faces().size()));
|
||||
project(tRes.ref(), field);
|
||||
return tRes;
|
||||
}
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -135,12 +135,12 @@ class sampledSurface
|
||||
void project
|
||||
(
|
||||
Field<ReturnType>&,
|
||||
const tmp<Field<Type> >&
|
||||
const tmp<Field<Type>>&
|
||||
) const;
|
||||
|
||||
//- Project field onto surface
|
||||
template<class ReturnType, class Type>
|
||||
tmp<Field<ReturnType> > project(const tmp<Field<Type> >&) const;
|
||||
tmp<Field<ReturnType>> project(const tmp<Field<Type>>&) const;
|
||||
|
||||
|
||||
protected:
|
||||
@ -295,7 +295,7 @@ public:
|
||||
|
||||
//- Integration of a field across the surface
|
||||
template<class Type>
|
||||
Type integrate(const tmp<Field<Type> >&) const;
|
||||
Type integrate(const tmp<Field<Type>>&) const;
|
||||
|
||||
//- Area-averaged value of a field across the surface
|
||||
template<class Type>
|
||||
@ -303,26 +303,26 @@ public:
|
||||
|
||||
//- Area-averaged value of a field across the surface
|
||||
template<class Type>
|
||||
Type average(const tmp<Field<Type> >&) const;
|
||||
Type average(const tmp<Field<Type>>&) const;
|
||||
|
||||
//- Project field onto surface
|
||||
tmp<Field<scalar> > project(const Field<scalar>&) const;
|
||||
tmp<Field<scalar>> project(const Field<scalar>&) const;
|
||||
|
||||
//- Project field onto surface
|
||||
tmp<Field<scalar> > project(const Field<vector>&) const;
|
||||
tmp<Field<scalar>> project(const Field<vector>&) const;
|
||||
|
||||
//- Project field onto surface
|
||||
tmp<Field<vector> > project(const Field<sphericalTensor>&) const;
|
||||
tmp<Field<vector>> project(const Field<sphericalTensor>&) const;
|
||||
|
||||
//- Project field onto surface
|
||||
tmp<Field<vector> > project(const Field<symmTensor>&) const;
|
||||
tmp<Field<vector>> project(const Field<symmTensor>&) const;
|
||||
|
||||
//- Project field onto surface
|
||||
tmp<Field<vector> > project(const Field<tensor>&) const;
|
||||
tmp<Field<vector>> project(const Field<tensor>&) const;
|
||||
|
||||
//- Interpolate from points to cell centre
|
||||
template<class Type>
|
||||
tmp<GeometricField<Type, fvPatchField, volMesh> > pointAverage
|
||||
tmp<GeometricField<Type, fvPatchField, volMesh>> pointAverage
|
||||
(
|
||||
const GeometricField<Type, pointPatchField, pointMesh>& pfld
|
||||
) const;
|
||||
@ -445,7 +445,7 @@ public:
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
# include "sampledSurfaceTemplates.C"
|
||||
#include "sampledSurfaceTemplates.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -49,7 +49,7 @@ bool Foam::sampledSurface::checkFieldSize(const Field<Type>& field) const
|
||||
template<class Type>
|
||||
Type Foam::sampledSurface::integrate(const Field<Type>& field) const
|
||||
{
|
||||
Type value = pTraits<Type>::zero;
|
||||
Type value = Zero;
|
||||
|
||||
if (checkFieldSize(field))
|
||||
{
|
||||
@ -62,7 +62,7 @@ Type Foam::sampledSurface::integrate(const Field<Type>& field) const
|
||||
|
||||
|
||||
template<class Type>
|
||||
Type Foam::sampledSurface::integrate(const tmp<Field<Type> >& field) const
|
||||
Type Foam::sampledSurface::integrate(const tmp<Field<Type>>& field) const
|
||||
{
|
||||
Type value = integrate(field());
|
||||
field.clear();
|
||||
@ -73,7 +73,7 @@ Type Foam::sampledSurface::integrate(const tmp<Field<Type> >& field) const
|
||||
template<class Type>
|
||||
Type Foam::sampledSurface::average(const Field<Type>& field) const
|
||||
{
|
||||
Type value = pTraits<Type>::zero;
|
||||
Type value = Zero;
|
||||
|
||||
if (checkFieldSize(field))
|
||||
{
|
||||
@ -89,13 +89,13 @@ Type Foam::sampledSurface::average(const Field<Type>& field) const
|
||||
}
|
||||
else
|
||||
{
|
||||
return pTraits<Type>::zero;
|
||||
return Zero;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Type Foam::sampledSurface::average(const tmp<Field<Type> >& field) const
|
||||
Type Foam::sampledSurface::average(const tmp<Field<Type>>& field) const
|
||||
{
|
||||
Type value = average(field());
|
||||
field.clear();
|
||||
@ -130,7 +130,7 @@ template<class ReturnType, class Type>
|
||||
void Foam::sampledSurface::project
|
||||
(
|
||||
Field<ReturnType>& res,
|
||||
const tmp<Field<Type> >& field
|
||||
const tmp<Field<Type>>& field
|
||||
) const
|
||||
{
|
||||
project(res, field());
|
||||
@ -139,20 +139,20 @@ void Foam::sampledSurface::project
|
||||
|
||||
|
||||
template<class ReturnType, class Type>
|
||||
Foam::tmp<Foam::Field<ReturnType> >
|
||||
Foam::tmp<Foam::Field<ReturnType>>
|
||||
Foam::sampledSurface::project
|
||||
(
|
||||
const tmp<Field<Type> >& field
|
||||
const tmp<Field<Type>>& field
|
||||
) const
|
||||
{
|
||||
tmp<Field<ReturnType> > tRes(new Field<ReturnType>(faces().size()));
|
||||
tmp<Field<ReturnType>> tRes(new Field<ReturnType>(faces().size()));
|
||||
project(tRes(), field);
|
||||
return tRes;
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::tmp<Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh> >
|
||||
Foam::tmp<Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>>
|
||||
Foam::sampledSurface::pointAverage
|
||||
(
|
||||
const GeometricField<Type, pointPatchField, pointMesh>& pfld
|
||||
@ -160,7 +160,7 @@ Foam::sampledSurface::pointAverage
|
||||
{
|
||||
const fvMesh& mesh = dynamic_cast<const fvMesh&>(pfld.mesh()());
|
||||
|
||||
tmp<GeometricField<Type, fvPatchField, volMesh> > tcellAvg
|
||||
tmp<GeometricField<Type, fvPatchField, volMesh>> tcellAvg
|
||||
(
|
||||
new GeometricField<Type, fvPatchField, volMesh>
|
||||
(
|
||||
@ -174,10 +174,10 @@ Foam::sampledSurface::pointAverage
|
||||
false
|
||||
),
|
||||
mesh,
|
||||
dimensioned<Type>("zero", dimless, pTraits<Type>::zero)
|
||||
dimensioned<Type>("zero", dimless, Zero)
|
||||
)
|
||||
);
|
||||
GeometricField<Type, fvPatchField, volMesh>& cellAvg = tcellAvg();
|
||||
GeometricField<Type, fvPatchField, volMesh>& cellAvg = tcellAvg.ref();
|
||||
|
||||
labelField nPointCells(mesh.nCells(), 0);
|
||||
{
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -252,7 +252,7 @@ public:
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
# include "sampledSurfacesTemplates.C"
|
||||
#include "sampledSurfacesTemplates.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -45,7 +45,7 @@ void Foam::sampledSurfaces::writeSurface
|
||||
if (Pstream::parRun())
|
||||
{
|
||||
// Collect values from all processors
|
||||
List<Field<Type> > gatheredValues(Pstream::nProcs());
|
||||
List<Field<Type>> gatheredValues(Pstream::nProcs());
|
||||
gatheredValues[Pstream::myProcNo()] = values;
|
||||
Pstream::gatherList(gatheredValues);
|
||||
|
||||
@ -54,10 +54,10 @@ void Foam::sampledSurfaces::writeSurface
|
||||
// Combine values into single field
|
||||
Field<Type> allValues
|
||||
(
|
||||
ListListOps::combine<Field<Type> >
|
||||
ListListOps::combine<Field<Type>>
|
||||
(
|
||||
gatheredValues,
|
||||
accessOp<Field<Type> >()
|
||||
accessOp<Field<Type>>()
|
||||
)
|
||||
);
|
||||
|
||||
@ -121,7 +121,7 @@ void Foam::sampledSurfaces::sampleAndWrite
|
||||
)
|
||||
{
|
||||
// interpolator for this field
|
||||
autoPtr<interpolation<Type> > interpolatorPtr;
|
||||
autoPtr<interpolation<Type>> interpolatorPtr;
|
||||
|
||||
const word& fieldName = vField.name();
|
||||
const fileName outputDir = outputPath_/vField.time().timeName();
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -118,7 +118,7 @@ private:
|
||||
mutable bool needsUpdate_;
|
||||
|
||||
//- Search tree for all non-coupled boundary faces
|
||||
mutable autoPtr<indexedOctree<treeDataFace> > boundaryTreePtr_;
|
||||
mutable autoPtr<indexedOctree<treeDataFace>> boundaryTreePtr_;
|
||||
|
||||
//- From local surface triangle to mesh cell/face.
|
||||
labelList sampleElements_;
|
||||
@ -134,14 +134,14 @@ private:
|
||||
|
||||
//- Sample field on faces
|
||||
template<class Type>
|
||||
tmp<Field<Type> > sampleField
|
||||
tmp<Field<Type>> sampleField
|
||||
(
|
||||
const GeometricField<Type, fvPatchField, volMesh>& vField
|
||||
) const;
|
||||
|
||||
|
||||
template<class Type>
|
||||
tmp<Field<Type> >
|
||||
tmp<Field<Type>>
|
||||
interpolateField(const interpolation<Type>&) const;
|
||||
|
||||
bool update(const meshSearch& meshSearcher);
|
||||
@ -291,7 +291,7 @@ public:
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
# include "sampledTriSurfaceMeshTemplates.C"
|
||||
#include "sampledTriSurfaceMeshTemplates.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -28,15 +28,15 @@ License
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
Foam::tmp<Foam::Field<Type> >
|
||||
Foam::tmp<Foam::Field<Type>>
|
||||
Foam::sampledTriSurfaceMesh::sampleField
|
||||
(
|
||||
const GeometricField<Type, fvPatchField, volMesh>& vField
|
||||
) const
|
||||
{
|
||||
// One value per face
|
||||
tmp<Field<Type> > tvalues(new Field<Type>(sampleElements_.size()));
|
||||
Field<Type>& values = tvalues();
|
||||
tmp<Field<Type>> tvalues(new Field<Type>(sampleElements_.size()));
|
||||
Field<Type>& values = tvalues.ref();
|
||||
|
||||
if (sampleSource_ == cells || sampleSource_ == insideCells)
|
||||
{
|
||||
@ -56,7 +56,7 @@ Foam::sampledTriSurfaceMesh::sampleField
|
||||
|
||||
// Create flat boundary field
|
||||
|
||||
Field<Type> bVals(nBnd, pTraits<Type>::zero);
|
||||
Field<Type> bVals(nBnd, Zero);
|
||||
|
||||
forAll(vField.boundaryField(), patchI)
|
||||
{
|
||||
@ -67,7 +67,7 @@ Foam::sampledTriSurfaceMesh::sampleField
|
||||
bVals,
|
||||
vField.boundaryField()[patchI].size(),
|
||||
bFaceI
|
||||
).assign(vField.boundaryField()[patchI]);
|
||||
) = vField.boundaryField()[patchI];
|
||||
}
|
||||
|
||||
// Sample in flat boundary field
|
||||
@ -84,15 +84,15 @@ Foam::sampledTriSurfaceMesh::sampleField
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::tmp<Foam::Field<Type> >
|
||||
Foam::tmp<Foam::Field<Type>>
|
||||
Foam::sampledTriSurfaceMesh::interpolateField
|
||||
(
|
||||
const interpolation<Type>& interpolator
|
||||
) const
|
||||
{
|
||||
// One value per vertex
|
||||
tmp<Field<Type> > tvalues(new Field<Type>(sampleElements_.size()));
|
||||
Field<Type>& values = tvalues();
|
||||
tmp<Field<Type>> tvalues(new Field<Type>(sampleElements_.size()));
|
||||
Field<Type>& values = tvalues.ref();
|
||||
|
||||
if (sampleSource_ == cells || sampleSource_ == insideCells)
|
||||
{
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -24,7 +24,6 @@ License
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "sampledThresholdCellFaces.H"
|
||||
|
||||
#include "dictionary.H"
|
||||
#include "volFields.H"
|
||||
#include "volPointInterpolation.H"
|
||||
@ -70,8 +69,7 @@ bool Foam::sampledThresholdCellFaces::updateGeometry() const
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "sampledThresholdCellFaces::updateGeometry() : lookup "
|
||||
<< fieldName_ << endl;
|
||||
InfoInFunction<< "Lookup " << fieldName_ << endl;
|
||||
}
|
||||
|
||||
cellFldPtr = &fvm.lookupObject<volScalarField>(fieldName_);
|
||||
@ -82,8 +80,9 @@ bool Foam::sampledThresholdCellFaces::updateGeometry() const
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Info<< "sampledThresholdCellFaces::updateGeometry() : reading "
|
||||
<< fieldName_ << " from time " << fvm.time().timeName()
|
||||
InfoInFunction
|
||||
<< "Reading " << fieldName_
|
||||
<< " from time " << fvm.time().timeName()
|
||||
<< endl;
|
||||
}
|
||||
|
||||
@ -167,14 +166,6 @@ Foam::sampledThresholdCellFaces::sampledThresholdCellFaces
|
||||
<< "require at least one of 'lowerLimit' or 'upperLimit'" << endl
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
// dict.readIfPresent("zone", zoneKey_);
|
||||
//
|
||||
// if (debug && zoneKey_.size() && mesh.cellZones().findZoneID(zoneKey_) < 0)
|
||||
// {
|
||||
// Info<< "cellZone " << zoneKey_
|
||||
// << " not found - using entire mesh" << endl;
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -90,14 +90,14 @@ class sampledThresholdCellFaces
|
||||
|
||||
//- Sample field on faces
|
||||
template<class Type>
|
||||
tmp<Field<Type> > sampleField
|
||||
tmp<Field<Type>> sampleField
|
||||
(
|
||||
const GeometricField<Type, fvPatchField, volMesh>& vField
|
||||
) const;
|
||||
|
||||
|
||||
template<class Type>
|
||||
tmp<Field<Type> >
|
||||
tmp<Field<Type>>
|
||||
interpolateField(const interpolation<Type>&) const;
|
||||
|
||||
|
||||
@ -211,7 +211,7 @@ public:
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
# include "sampledThresholdCellFacesTemplates.C"
|
||||
#include "sampledThresholdCellFacesTemplates.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -33,7 +33,7 @@ License
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
Foam::tmp<Foam::Field<Type> >
|
||||
Foam::tmp<Foam::Field<Type>>
|
||||
Foam::sampledThresholdCellFaces::sampleField
|
||||
(
|
||||
const GeometricField<Type, fvPatchField, volMesh>& vField
|
||||
@ -42,12 +42,12 @@ Foam::sampledThresholdCellFaces::sampleField
|
||||
// Recreate geometry if time has changed
|
||||
updateGeometry();
|
||||
|
||||
return tmp<Field<Type> >(new Field<Type>(vField, meshCells_));
|
||||
return tmp<Field<Type>>(new Field<Type>(vField, meshCells_));
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::tmp<Foam::Field<Type> >
|
||||
Foam::tmp<Foam::Field<Type>>
|
||||
Foam::sampledThresholdCellFaces::interpolateField
|
||||
(
|
||||
const interpolation<Type>& interpolator
|
||||
@ -57,8 +57,8 @@ Foam::sampledThresholdCellFaces::interpolateField
|
||||
updateGeometry();
|
||||
|
||||
// One value per point
|
||||
tmp<Field<Type> > tvalues(new Field<Type>(points().size()));
|
||||
Field<Type>& values = tvalues();
|
||||
tmp<Field<Type>> tvalues(new Field<Type>(points().size()));
|
||||
Field<Type>& values = tvalues.ref();
|
||||
|
||||
boolList pointDone(points().size(), false);
|
||||
|
||||
|
||||
@ -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-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -41,43 +41,43 @@ namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#define makeSurfaceWriterType(ThisClass) \
|
||||
defineTypeNameAndDebug(ThisClass, 0); \
|
||||
#define makeSurfaceWriterType(ThisClass) \
|
||||
defineTypeNameAndDebug(ThisClass, 0); \
|
||||
addToRunTimeSelectionTable(surfaceWriter, ThisClass, word)
|
||||
|
||||
|
||||
#define defineSurfaceWriterWriteField(ThisClass, FieldType) \
|
||||
Foam::fileName ThisClass::write \
|
||||
( \
|
||||
const fileName& outputDir, \
|
||||
const fileName& surfaceName, \
|
||||
const pointField& points, \
|
||||
const faceList& faces, \
|
||||
const word& fieldName, \
|
||||
const Field<FieldType>& values, \
|
||||
const bool isNodeValues, \
|
||||
const bool verbose \
|
||||
) const \
|
||||
{ \
|
||||
return writeTemplate \
|
||||
( \
|
||||
outputDir, \
|
||||
surfaceName, \
|
||||
points, \
|
||||
faces, \
|
||||
fieldName, \
|
||||
values, \
|
||||
isNodeValues, \
|
||||
verbose \
|
||||
); \
|
||||
#define defineSurfaceWriterWriteField(ThisClass, FieldType) \
|
||||
void ThisClass::write \
|
||||
( \
|
||||
const fileName& outputDir, \
|
||||
const fileName& surfaceName, \
|
||||
const pointField& points, \
|
||||
const faceList& faces, \
|
||||
const word& fieldName, \
|
||||
const Field<FieldType>& values, \
|
||||
const bool isNodeValues, \
|
||||
const bool verbose \
|
||||
) const \
|
||||
{ \
|
||||
writeTemplate \
|
||||
( \
|
||||
outputDir, \
|
||||
surfaceName, \
|
||||
points, \
|
||||
faces, \
|
||||
fieldName, \
|
||||
values, \
|
||||
isNodeValues, \
|
||||
verbose \
|
||||
); \
|
||||
}
|
||||
|
||||
|
||||
#define defineSurfaceWriterWriteFields(ThisClass) \
|
||||
defineSurfaceWriterWriteField(ThisClass, scalar); \
|
||||
defineSurfaceWriterWriteField(ThisClass, vector); \
|
||||
defineSurfaceWriterWriteField(ThisClass, sphericalTensor); \
|
||||
defineSurfaceWriterWriteField(ThisClass, symmTensor); \
|
||||
#define defineSurfaceWriterWriteFields(ThisClass) \
|
||||
defineSurfaceWriterWriteField(ThisClass, scalar); \
|
||||
defineSurfaceWriterWriteField(ThisClass, vector); \
|
||||
defineSurfaceWriterWriteField(ThisClass, sphericalTensor); \
|
||||
defineSurfaceWriterWriteField(ThisClass, symmTensor); \
|
||||
defineSurfaceWriterWriteField(ThisClass, tensor)
|
||||
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -288,7 +288,7 @@ void Foam::nastranSurfaceWriter::writeGeometry
|
||||
(
|
||||
const pointField& points,
|
||||
const faceList& faces,
|
||||
List<DynamicList<face> >& decomposedFaces,
|
||||
List<DynamicList<face>>& decomposedFaces,
|
||||
OFstream& os
|
||||
) const
|
||||
{
|
||||
@ -408,7 +408,7 @@ Foam::nastranSurfaceWriter::nastranSurfaceWriter(const dictionary& options)
|
||||
separator_ = ",";
|
||||
}
|
||||
|
||||
List<Tuple2<word, word> > fieldSet(options.lookup("fields"));
|
||||
List<Tuple2<word, word>> fieldSet(options.lookup("fields"));
|
||||
|
||||
forAll(fieldSet, i)
|
||||
{
|
||||
@ -453,7 +453,7 @@ Foam::fileName Foam::nastranSurfaceWriter::write
|
||||
<< "$" << nl
|
||||
<< "BEGIN BULK" << nl;
|
||||
|
||||
List<DynamicList<face> > decomposedFaces(faces.size());
|
||||
List<DynamicList<face>> decomposedFaces(faces.size());
|
||||
|
||||
writeGeometry(points, faces, decomposedFaces, os);
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -135,7 +135,7 @@ private:
|
||||
(
|
||||
const pointField& points,
|
||||
const faceList& faces,
|
||||
List<DynamicList<face> >& decomposedFaces,
|
||||
List<DynamicList<face>>& decomposedFaces,
|
||||
OFstream& os
|
||||
) const;
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -192,7 +192,7 @@ Foam::fileName Foam::nastranSurfaceWriter::writeTemplate
|
||||
<< "$" << nl
|
||||
<< "BEGIN BULK" << nl;
|
||||
|
||||
List<DynamicList<face> > decomposedFaces(faces.size());
|
||||
List<DynamicList<face>> decomposedFaces(faces.size());
|
||||
|
||||
writeGeometry(points, faces, decomposedFaces, os);
|
||||
|
||||
@ -210,7 +210,7 @@ Foam::fileName Foam::nastranSurfaceWriter::writeTemplate
|
||||
const DynamicList<face>& dFaces = decomposedFaces[i];
|
||||
forAll(dFaces, faceI)
|
||||
{
|
||||
Type v = pTraits<Type>::zero;
|
||||
Type v = Zero;
|
||||
const face& f = dFaces[faceI];
|
||||
|
||||
forAll(f, fptI)
|
||||
|
||||
@ -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-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -31,6 +31,7 @@ License
|
||||
namespace Foam
|
||||
{
|
||||
makeSurfaceWriterType(rawSurfaceWriter);
|
||||
addToRunTimeSelectionTable(surfaceWriter, rawSurfaceWriter, wordDict);
|
||||
}
|
||||
|
||||
|
||||
@ -207,10 +208,24 @@ namespace Foam
|
||||
|
||||
Foam::rawSurfaceWriter::rawSurfaceWriter()
|
||||
:
|
||||
surfaceWriter()
|
||||
surfaceWriter(),
|
||||
writeCompression_(IOstream::UNCOMPRESSED)
|
||||
{}
|
||||
|
||||
|
||||
Foam::rawSurfaceWriter::rawSurfaceWriter(const dictionary& options)
|
||||
:
|
||||
surfaceWriter(),
|
||||
writeCompression_(IOstream::UNCOMPRESSED)
|
||||
{
|
||||
if (options.found("compression"))
|
||||
{
|
||||
writeCompression_ =
|
||||
IOstream::compressionEnum(options.lookup("compression"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::rawSurfaceWriter::~rawSurfaceWriter()
|
||||
@ -233,7 +248,13 @@ Foam::fileName Foam::rawSurfaceWriter::write
|
||||
mkDir(outputDir);
|
||||
}
|
||||
|
||||
OFstream os(outputDir/surfaceName + ".raw");
|
||||
OFstream os
|
||||
(
|
||||
outputDir/surfaceName + ".raw",
|
||||
IOstream::ASCII,
|
||||
IOstream::currentVersion,
|
||||
writeCompression_
|
||||
);
|
||||
|
||||
if (verbose)
|
||||
{
|
||||
@ -241,7 +262,7 @@ Foam::fileName Foam::rawSurfaceWriter::write
|
||||
}
|
||||
|
||||
|
||||
// header
|
||||
// Header
|
||||
os << "# geometry NO_DATA " << faces.size() << nl
|
||||
<< "# x y z" << nl;
|
||||
|
||||
@ -258,7 +279,9 @@ Foam::fileName Foam::rawSurfaceWriter::write
|
||||
}
|
||||
|
||||
|
||||
// create write methods
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
// Create write methods
|
||||
defineSurfaceWriterWriteFields(Foam::rawSurfaceWriter);
|
||||
|
||||
|
||||
|
||||
@ -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-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -51,6 +51,12 @@ class rawSurfaceWriter
|
||||
:
|
||||
public surfaceWriter
|
||||
{
|
||||
// Private data
|
||||
|
||||
//- Output compression, defaults to uncompressed
|
||||
IOstream::compressionType writeCompression_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
static inline void writeLocation
|
||||
@ -106,6 +112,9 @@ public:
|
||||
//- Construct null
|
||||
rawSurfaceWriter();
|
||||
|
||||
//- Construct with some output options
|
||||
rawSurfaceWriter(const dictionary& options);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~rawSurfaceWriter();
|
||||
|
||||
@ -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-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -51,7 +51,7 @@ void Foam::vtkSurfaceWriter::writeGeometry
|
||||
<< "DATASET POLYDATA" << nl;
|
||||
|
||||
// Write vertex coords
|
||||
os << "POINTS " << points.size() << " float" << nl;
|
||||
os << "POINTS " << points.size() << " double" << nl;
|
||||
forAll(points, pointI)
|
||||
{
|
||||
const point& pt = points[pointI];
|
||||
|
||||
Reference in New Issue
Block a user