Coupled patch transformations: Removed the hideous and unphysical non-uniform transformation support

The implementation of the optional non-uniform transformations in coupled
patches was based on transform property lists which could be either length 0 for
no transformation, 1 for uniform transformation or n-faces for non-uniform
transformation.  This complexity was maintenance nightmare but kept to support
the hack in the original film implementation to partially work around the
conservation error.  Now that film has been re-implemented in fully mass
conservative form this unphysical non-uniform transformation support is no
longer needed and the coupled patch transformations have been completely
refactored to be simpler and more rational with single values for the
transformation properties and boolians to indicate which transformations are
needed.
This commit is contained in:
Henry Weller
2019-12-25 11:26:30 +00:00
parent bae37a52a6
commit 03207b1538
53 changed files with 322 additions and 618 deletions

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -261,38 +261,6 @@ void writeCyclicMatchObjs(const fileName& prefix, const polyMesh& mesh)
}
void separateList
(
const vectorField& separation,
UList<vector>& field
)
{
if (separation.size() == 1)
{
// Single value for all.
forAll(field, i)
{
field[i] += separation[0];
}
}
else if (separation.size() == field.size())
{
forAll(field, i)
{
field[i] += separation[i];
}
}
else
{
FatalErrorInFunction
<< "Sizes of field and transformation not equal. field:"
<< field.size() << " transformation:" << separation.size()
<< abort(FatalError);
}
}
// Synchronise points on both sides of coupled boundaries.
template<class CombineOp>
void syncPoints
@ -397,7 +365,7 @@ void syncPoints
else if (procPatch.separated())
{
hasTransformation = true;
separateList(-procPatch.separation(), nbrPatchInfo);
nbrPatchInfo -= procPatch.separation();
}
const labelList& meshPts = procPatch.meshPoints();
@ -447,7 +415,7 @@ void syncPoints
else if (cycPatch.separated())
{
hasTransformation = true;
separateList(cycPatch.separation(), half0Values);
half0Values += cycPatch.separation();
}
forAll(coupledPoints, i)
@ -800,8 +768,8 @@ int main(int argc, char *argv[])
if (cpp.separated())
{
Info<< "On coupled patch " << pp.name()
<< " separation[0] was "
<< cpp.separation()[0] << endl;
<< " separation was "
<< cpp.separation() << endl;
if (isA<cyclicPolyPatch>(pp) && pp.size())
{
@ -814,19 +782,15 @@ int main(int argc, char *argv[])
Info<< "On cyclic translation patch " << pp.name()
<< " forcing uniform separation of "
<< cycpp.separationVector() << endl;
const_cast<vectorField&>(cpp.separation()) =
pointField(1, cycpp.separationVector());
const_cast<vector&>(cpp.separation()) =
cycpp.separationVector();
}
else
{
const cyclicPolyPatch& nbr = cycpp.neighbPatch();
const_cast<vectorField&>(cpp.separation()) =
pointField
(
1,
nbr[0].centre(mesh.points())
- cycpp[0].centre(mesh.points())
);
const_cast<vector&>(cpp.separation()) =
nbr[0].centre(mesh.points())
- cycpp[0].centre(mesh.points());
}
}
Info<< "On coupled patch " << pp.name()
@ -835,22 +799,18 @@ int main(int argc, char *argv[])
}
else if (!cpp.parallel())
{
Info<< "On coupled patch " << pp.name()
<< " forcing uniform rotation of "
<< cpp.forwardT()[0] << endl;
const_cast<tensorField&>
(
cpp.forwardT()
).setSize(1);
const_cast<tensorField&>
(
cpp.reverseT()
).setSize(1);
Info<< "On coupled patch " << pp.name()
<< " forcing uniform rotation of "
<< cpp.forwardT() << endl;
// const_cast<tensorField&>
// (
// cpp.forwardT()
// ).setSize(1);
// const_cast<tensorField&>
// (
// cpp.reverseT()
// ).setSize(1);
}
}
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -147,8 +147,8 @@ void Foam::cyclicPointPatchField<Type>::swapAddSeparated
label nbrPointi = pairs[pairi][1];
Type tmp = pf[pointi];
pf[pointi] = transform(forwardT()[0], nbrPf[nbrPointi]);
nbrPf[nbrPointi] = transform(reverseT()[0], tmp);
pf[pointi] = transform(forwardT(), nbrPf[nbrPointi]);
nbrPf[nbrPointi] = transform(reverseT(), tmp);
}
}
else

View File

@ -127,7 +127,7 @@ public:
// Member Functions
//- Constraint handling
// Constraint handling
//- Return the constraint type this pointPatchField implements
virtual const word& constraintType() const
@ -135,7 +135,8 @@ public:
return cyclicPointPatch::typeName;
}
//- Cyclic coupled interface functions
// Cyclic coupled interface functions
//- Does the patch field perform the transformation
virtual bool doTransform() const
@ -144,13 +145,13 @@ public:
}
//- Return face transformation tensor
virtual const tensorField& forwardT() const
virtual const tensor& forwardT() const
{
return cyclicPatch_.forwardT();
}
//- Return neighbour-cell transformation tensor
virtual const tensorField& reverseT() const
virtual const tensor& reverseT() const
{
return cyclicPatch_.reverseT();
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -167,9 +167,8 @@ void Foam::processorCyclicPointPatchField<Type>::swapAddSeparated
{
const processorCyclicPolyPatch& ppp =
procPatch_.procCyclicPolyPatch();
const tensor& forwardT = ppp.forwardT()[0];
transform(receiveBuf_, forwardT, receiveBuf_);
transform(receiveBuf_, ppp.forwardT(), receiveBuf_);
}
// All points are separated

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -74,10 +74,10 @@ public:
virtual const cyclicLduInterface& neighbPatch() const = 0;
//- Return face transformation tensor
virtual const tensorField& forwardT() const = 0;
virtual const tensor& forwardT() const = 0;
//- Return face reverse transformation tensor
virtual const tensorField& reverseT() const = 0;
virtual const tensor& reverseT() const = 0;
};

View File

@ -94,7 +94,7 @@ public:
virtual int neighbProcNo() const = 0;
//- Return face transformation tensor
virtual const tensorField& forwardT() const = 0;
virtual const tensor& forwardT() const = 0;
//- Return message tag used for sending
virtual int tag() const = 0;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -50,14 +50,7 @@ void Foam::cyclicLduInterfaceField::transformCoupleField
{
if (doTransform())
{
if (forwardT().size() == 1)
{
f *= pow(diag(forwardT()[0]).component(cmpt), rank());
}
else
{
f *= pow(diag(forwardT())().component(cmpt), rank());
}
f *= pow(diag(forwardT()).component(cmpt), rank());
}
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -75,10 +75,10 @@ public:
virtual bool doTransform() const = 0;
//- Return face transformation tensor
virtual const tensorField& forwardT() const = 0;
virtual const tensor& forwardT() const = 0;
//- Return neighbour-cell transformation tensor
virtual const tensorField& reverseT() const = 0;
virtual const tensor& reverseT() const = 0;
//- Return rank of component for transform
virtual int rank() const = 0;
@ -113,14 +113,7 @@ void Foam::cyclicLduInterfaceField::transformCoupleField
{
if (doTransform())
{
if (forwardT().size() == 1)
{
transform(f, forwardT()[0], f);
}
else
{
transform(f, forwardT(), f);
}
transform(f, forwardT(), f);
}
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -50,14 +50,7 @@ void Foam::processorLduInterfaceField::transformCoupleField
{
if (doTransform())
{
if (forwardT().size() == 1)
{
f *= pow(diag(forwardT()[0]).component(cmpt), rank());
}
else
{
f *= pow(diag(forwardT())().component(cmpt), rank());
}
f *= pow(diag(forwardT()).component(cmpt), rank());
}
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -84,7 +84,7 @@ public:
virtual bool doTransform() const = 0;
//- Return face transformation tensor
virtual const tensorField& forwardT() const = 0;
virtual const tensor& forwardT() const = 0;
//- Return rank of component for transform
virtual int rank() const = 0;
@ -119,14 +119,7 @@ void Foam::processorLduInterfaceField::transformCoupleField
{
if (doTransform())
{
if (forwardT().size() == 1)
{
transform(f, forwardT()[0], f);
}
else
{
transform(f, forwardT(), f);
}
transform(f, forwardT(), f);
}
}

View File

@ -116,13 +116,13 @@ public:
}
//- Return face transformation tensor
virtual const tensorField& forwardT() const
virtual const tensor& forwardT() const
{
return cyclicInterface_.forwardT();
}
//- Return neighbour-cell transformation tensor
virtual const tensorField& reverseT() const
virtual const tensor& reverseT() const
{
return cyclicInterface_.reverseT();
}

View File

@ -175,7 +175,7 @@ public:
}
//- Return face transformation tensor
virtual const tensorField& forwardT() const
virtual const tensor& forwardT() const
{
return procInterface_.forwardT();
}

View File

@ -61,10 +61,10 @@ class cyclicGAMGInterface
bool owner_;
//- Transformation tensor
tensorField forwardT_;
tensor forwardT_;
//- Transformation tensor
tensorField reverseT_;
tensor reverseT_;
public:
@ -138,13 +138,13 @@ public:
}
//- Return face transformation tensor
virtual const tensorField& forwardT() const
virtual const tensor& forwardT() const
{
return forwardT_;
}
//- Return neighbour-cell transformation tensor
virtual const tensorField& reverseT() const
virtual const tensor& reverseT() const
{
return reverseT_;
}

View File

@ -146,7 +146,7 @@ Foam::processorGAMGInterface::processorGAMGInterface
const label coarseComm,
const label myProcNo,
const label neighbProcNo,
const tensorField& forwardT,
const tensor& forwardT,
const int tag
)
:

View File

@ -64,7 +64,7 @@ class processorGAMGInterface
label neighbProcNo_;
//- Transformation tensor
tensorField forwardT_;
tensor forwardT_;
//- Message tag used for sending
int tag_;
@ -100,7 +100,7 @@ public:
const label coarseComm,
const label myProcNo,
const label neighbProcNo,
const tensorField& forwardT,
const tensor& forwardT,
const int tag
);
@ -160,7 +160,7 @@ public:
}
//- Return face transformation tensor
virtual const tensorField& forwardT() const
virtual const tensor& forwardT() const
{
return forwardT_;
}

View File

@ -926,7 +926,7 @@ Foam::lduPrimitiveMesh::lduPrimitiveMesh
comm_,
myAgglom,
neighbProcNo,
tensorField(), // forwardT
Zero, // forwardT
Pstream::msgType() // tag
)
);

View File

@ -139,13 +139,13 @@ public:
}
//- Return face transformation tensor
const tensorField& forwardT() const
const tensor& forwardT() const
{
return cyclicPolyPatch_.forwardT();
}
//- Return neighbour-cell transformation tensor
const tensorField& reverseT() const
const tensor& reverseT() const
{
return cyclicPolyPatch_.reverseT();
}

View File

@ -322,10 +322,8 @@ void Foam::coupledPolyPatch::calcTransformTensors
if (Cf.size() == 0)
{
// Dummy geometry. Assume non-separated, parallel.
separation_.setSize(0);
forwardT_.clear();
reverseT_.clear();
collocated_.setSize(0);
parallel_ = true;
separated_ = false;
}
else
{
@ -348,70 +346,56 @@ void Foam::coupledPolyPatch::calcTransformTensors
{
// Type is rotation or unknown and normals not aligned
// Assume per-face differing transformation, correct later
parallel_ = false;
separated_ = false;
separation_ = Zero;
separation_.setSize(0);
tensorField forwardT(Cf.size());
tensorField reverseT(Cf.size());
forwardT_.setSize(Cf.size());
reverseT_.setSize(Cf.size());
collocated_.setSize(Cf.size());
collocated_ = false;
forAll(forwardT_, facei)
forAll(forwardT, facei)
{
forwardT_[facei] = rotationTensor(-nr[facei], nf[facei]);
reverseT_[facei] = rotationTensor(nf[facei], -nr[facei]);
forwardT[facei] = rotationTensor(-nr[facei], nf[facei]);
reverseT[facei] = rotationTensor(nf[facei], -nr[facei]);
}
if (debug)
if (sum(mag(forwardT - forwardT[0])) > error)
{
Pout<< " sum(mag(forwardT_ - forwardT_[0])):"
<< sum(mag(forwardT_ - forwardT_[0]))
<< endl;
Pout<< "--> FOAM Warning : "
<< " Variation in rotation greater than"
<< " local tolerance " << error << endl;
}
if (sum(mag(forwardT_ - forwardT_[0])) < error)
{
forwardT_.setSize(1);
reverseT_.setSize(1);
collocated_.setSize(1);
if (debug)
{
Pout<< " difference in rotation less than"
<< " local tolerance "
<< error << ". Assuming uniform rotation." << endl;
}
}
forwardT_ = forwardT[0];
reverseT_ = reverseT[0];
}
else
{
// Translational or (unknown and normals aligned)
forwardT_.setSize(0);
reverseT_.setSize(0);
parallel_ = true;
separation_ = Cr - Cf;
forwardT_ = Zero;
reverseT_ = Zero;
collocated_.setSize(separation_.size());
// Three situations:
// - separation is zero. No separation.
// - separation is same. Single separation vector.
// - separation differs per face. Separation vectorField.
// - separation differs per face -> error.
// Check for different separation per face
bool sameSeparation = true;
bool doneWarning = false;
forAll(separation_, facei)
{
scalar smallSqr = sqr(smallDist[facei]);
const vectorField separation(Cr - Cf);
collocated_[facei] = (magSqr(separation_[facei]) < smallSqr);
forAll(separation, facei)
{
const scalar smallSqr = sqr(smallDist[facei]);
// Check if separation differing w.r.t. face 0.
if (magSqr(separation_[facei] - separation_[0]) > smallSqr)
if (magSqr(separation[facei] - separation[0]) > smallSqr)
{
sameSeparation = false;
@ -419,9 +403,9 @@ void Foam::coupledPolyPatch::calcTransformTensors
{
doneWarning = true;
Pout<< " separation " << separation_[facei]
Pout<< " separation " << separation[facei]
<< " at " << facei
<< " differs from separation[0] " << separation_[0]
<< " differs from separation[0] " << separation[0]
<< " by more than local tolerance "
<< smallDist[facei]
<< ". Assuming non-uniform separation." << endl;
@ -431,39 +415,42 @@ void Foam::coupledPolyPatch::calcTransformTensors
if (sameSeparation)
{
// Check for zero separation (at 0 so everywhere)
if (collocated_[0])
// Check for zero separation
if (mag(separation[0]) < smallDist[0])
{
if (debug)
{
Pout<< " separation " << mag(separation_[0])
Pout<< " separation " << mag(separation[0])
<< " less than local tolerance " << smallDist[0]
<< ". Assuming zero separation." << endl;
}
separation_.setSize(0);
collocated_ = boolList(1, true);
separated_ = false;
separation_ = Zero;
}
else
{
if (debug)
{
Pout<< " separation " << mag(separation_[0])
Pout<< " separation " << mag(separation[0])
<< " more than local tolerance " << smallDist[0]
<< ". Assuming uniform separation." << endl;
}
separation_.setSize(1);
collocated_ = boolList(1, false);
separated_ = true;
separation_ = separation[0];
}
}
}
}
else
{
Pout<< "--> FOAM Warning : "
<< " Variation in separation greater than"
<< " local tolerance " << smallDist[0] << endl;
if (debug)
{
Pout<< " separation_:" << separation_.size() << nl
<< " forwardT size:" << forwardT_.size() << endl;
separated_ = true;
separation_ = separation[0];
}
}
}
}
@ -483,7 +470,9 @@ Foam::coupledPolyPatch::coupledPolyPatch
:
polyPatch(name, size, start, index, bm, patchType),
matchTolerance_(defaultMatchTol_),
transform_(transform)
transform_(transform),
parallel_(true),
separated_(false)
{}
@ -504,7 +493,9 @@ Foam::coupledPolyPatch::coupledPolyPatch
dict.found("transform")
? transformTypeNames.read(dict.lookup("transform"))
: defaultTransform
)
),
parallel_(true),
separated_(false)
{}
@ -516,7 +507,9 @@ Foam::coupledPolyPatch::coupledPolyPatch
:
polyPatch(pp, bm),
matchTolerance_(pp.matchTolerance_),
transform_(pp.transform_)
transform_(pp.transform_),
parallel_(true),
separated_(false)
{}
@ -531,7 +524,9 @@ Foam::coupledPolyPatch::coupledPolyPatch
:
polyPatch(pp, bm, index, newSize, newStart),
matchTolerance_(pp.matchTolerance_),
transform_(pp.transform_)
transform_(pp.transform_),
parallel_(true),
separated_(false)
{}
@ -546,7 +541,9 @@ Foam::coupledPolyPatch::coupledPolyPatch
:
polyPatch(pp, bm, index, mapAddressing, newStart),
matchTolerance_(pp.matchTolerance_),
transform_(pp.transform_)
transform_(pp.transform_),
parallel_(true),
separated_(false)
{}
@ -561,11 +558,8 @@ Foam::coupledPolyPatch::~coupledPolyPatch()
void Foam::coupledPolyPatch::write(Ostream& os) const
{
polyPatch::write(os);
// if (matchTolerance_ != defaultMatchTol_)
{
writeEntry(os, "matchTolerance", matchTolerance_);
writeEntry(os, "transform", transformTypeNames[transform_]);
}
writeEntry(os, "matchTolerance", matchTolerance_);
writeEntry(os, "transform", transformTypeNames[transform_]);
}

View File

@ -68,9 +68,9 @@ public:
static const NamedEnum<transformType, 5> transformTypeNames;
private:
protected:
// Private Data
// Protected Data
//- Default matching tolerance
static const scalar defaultMatchTol_;
@ -81,17 +81,21 @@ private:
//- Type of transformation
transformType transform_;
//- Are coupled patches parallel
mutable bool parallel_;
//- Are coupled patches separated
mutable bool separated_;
//- Offset (distance) vector from one side of the couple to the other
mutable vectorField separation_;
mutable vector separation_;
//- Face transformation tensor
mutable tensorField forwardT_;
mutable tensor forwardT_;
//- Neighbour-cell transformation tensor
mutable tensorField reverseT_;
mutable tensor reverseT_;
//- Are faces collocated. Either size 0,1 or length of patch.
mutable boolList collocated_;
protected:
@ -274,42 +278,36 @@ public:
//- Transform a patch-based position from other side to this side
virtual void transformPosition(point&, const label facei) const = 0;
//- Are the cyclic planes parallel.
virtual bool parallel() const
{
return parallel_;
}
//- Are the planes separated.
virtual bool separated() const
{
return separation_.size();
return separated_;
}
//- If the planes are separated the separation vector.
virtual const vectorField& separation() const
virtual const vector& separation() const
{
return separation_;
}
//- Are the cyclic planes parallel.
virtual bool parallel() const
{
return forwardT_.empty();
}
//- Return face transformation tensor.
virtual const tensorField& forwardT() const
virtual const tensor& forwardT() const
{
return forwardT_;
}
//- Return neighbour-cell transformation tensor.
virtual const tensorField& reverseT() const
virtual const tensor& reverseT() const
{
return reverseT_;
}
//- Are faces collocated. Either size 0,1 or length of patch
virtual const boolList& collocated() const
{
return collocated_;
}
scalar matchTolerance() const
{
return matchTolerance_;

View File

@ -291,10 +291,11 @@ void Foam::cyclicPolyPatch::calcTransforms
);
const tensor revT(E1.T() & E0);
const_cast<tensorField&>(forwardT()) = tensorField(1, revT.T());
const_cast<tensorField&>(reverseT()) = tensorField(1, revT);
const_cast<vectorField&>(separation()).setSize(0);
const_cast<boolList&>(collocated()) = boolList(1, false);
parallel_ = false;
separated_ = false;
separation_ = Zero;
forwardT_ = revT.T();
reverseT_ = revT;
}
else
{
@ -351,11 +352,7 @@ void Foam::cyclicPolyPatch::calcTransforms
// Override computed transform with specified.
if
(
separation().size() != 1
|| mag(separation()[0] - separationVector_) > avgTol
)
if (mag(separation() - separationVector_) > avgTol)
{
WarningInFunction
<< "Specified separationVector " << separationVector_
@ -372,14 +369,11 @@ void Foam::cyclicPolyPatch::calcTransforms
}
// Set tensors
const_cast<tensorField&>(forwardT()).clear();
const_cast<tensorField&>(reverseT()).clear();
const_cast<vectorField&>(separation()) = vectorField
(
1,
separationVector_
);
const_cast<boolList&>(collocated()) = boolList(1, false);
parallel_ = true;
separated_ = true;
separation_ = separationVector_;
forwardT_ = Zero;
reverseT_ = Zero;
}
}
}
@ -869,19 +863,7 @@ void Foam::cyclicPolyPatch::transformPosition(pointField& l) const
{
// transformPosition gets called on the receiving side,
// separation gets calculated on the sending side so subtract.
const vectorField& s = separation();
if (s.size() == 1)
{
forAll(l, i)
{
l[i] -= s[0];
}
}
else
{
l -= s;
}
l -= separation();
}
}
@ -890,32 +872,19 @@ void Foam::cyclicPolyPatch::transformPosition(point& l, const label facei) const
{
if (!parallel())
{
const tensor& T =
(
forwardT().size() == 1
? forwardT()[0]
: forwardT()[facei]
);
if (transform() == ROTATIONAL)
{
l = Foam::transform(T, l-rotationCentre_) + rotationCentre_;
l = Foam::transform(forwardT(), l - rotationCentre_)
+ rotationCentre_;
}
else
{
l = Foam::transform(T, l);
l = Foam::transform(forwardT(), l);
}
}
else if (separated())
{
const vector& s =
(
separation().size() == 1
? separation()[0]
: separation()[facei]
);
l -= s;
l -= separation();
}
}

View File

@ -308,17 +308,6 @@ void Foam::processorPolyPatch::calcGeometry(PstreamBuffers& pBufs)
nbrFaceNormals[facei] = neighbFaceAreas_[facei]/nbrMagSf;
}
}
calcTransformTensors
(
faceCentres(),
neighbFaceCentres_,
faceNormals,
nbrFaceNormals,
matchTolerance()*tols,
matchTolerance(),
transform()
);
}
}

View File

@ -237,6 +237,16 @@ void Foam::processorCyclicPolyPatch::calcGeometry(PstreamBuffers& pBufs)
if (Pstream::parRun())
{
calcTransformTensors
(
faceCentres(),
neighbFaceCentres(),
faceAreas()/mag(faceAreas()),
neighbFaceAreas()/mag(neighbFaceAreas()),
matchTolerance()*calcFaceTol(*this, points(), faceCentres()),
matchTolerance(),
transform()
);
// Where do we store the calculated transformation?
// - on the processor patch?

View File

@ -352,7 +352,7 @@ public:
}
//- If the planes are separated the separation vector.
virtual const vectorField& separation() const
virtual const vector& separation() const
{
return referPatch().separation();
}
@ -364,24 +364,17 @@ public:
}
//- Return face transformation tensor.
virtual const tensorField& forwardT() const
virtual const tensor& forwardT() const
{
return referPatch().forwardT();
}
//- Return neighbour-cell transformation tensor.
virtual const tensorField& reverseT() const
virtual const tensor& reverseT() const
{
return referPatch().reverseT();
}
//- Are faces collocated. Either size 0,1 or length of patch
virtual const boolList& collocated() const
{
return referPatch().collocated();
}
//- Initialize ordering for primitivePatch. Does not
// refer to *this (except for name() and type() etc.)
virtual void initOrder(PstreamBuffers&, const primitivePatch&) const;
@ -399,7 +392,6 @@ public:
labelList& rotation
) const;
//- Write the polyPatch data as a dictionary
virtual void write(Ostream&) const;
};

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -159,61 +159,51 @@ void Foam::globalIndexAndTransform::determineTransforms()
if (cpp.separated())
{
const vectorField& sepVecs = cpp.separation();
const vector& sepVec = cpp.separation();
forAll(sepVecs, sVI)
if (mag(sepVec) > small)
{
const vector& sepVec = sepVecs[sVI];
vectorTensorTransform transform(sepVec);
if (mag(sepVec) > small)
{
vectorTensorTransform transform(sepVec);
if
if
(
matchTransform
(
matchTransform
(
localTransforms,
dummyMatch,
transform,
cpp.matchTolerance(),
false
) == 0
)
{
localTransforms.append(transform);
localTols.append(cpp.matchTolerance());
}
localTransforms,
dummyMatch,
transform,
cpp.matchTolerance(),
false
) == 0
)
{
localTransforms.append(transform);
localTols.append(cpp.matchTolerance());
}
}
}
else if (!cpp.parallel())
{
const tensorField& transTensors = cpp.reverseT();
const tensor& transT = cpp.reverseT();
forAll(transTensors, tTI)
if (mag(transT - I) > small)
{
const tensor& transT = transTensors[tTI];
vectorTensorTransform transform(transT);
if (mag(transT - I) > small)
{
vectorTensorTransform transform(transT);
if
if
(
matchTransform
(
matchTransform
(
localTransforms,
dummyMatch,
transform,
cpp.matchTolerance(),
false
) == 0
)
{
localTransforms.append(transform);
localTols.append(cpp.matchTolerance());
}
localTransforms,
dummyMatch,
transform,
cpp.matchTolerance(),
false
) == 0
)
{
localTransforms.append(transform);
localTols.append(cpp.matchTolerance());
}
}
}
@ -343,60 +333,43 @@ void Foam::globalIndexAndTransform::determinePatchTransformSign()
if (cpp.separated())
{
const vectorField& sepVecs = cpp.separation();
const vector& sepVec = cpp.separation();
// This loop is implicitly expecting only a single
// value for separation()
forAll(sepVecs, sVI)
if (mag(sepVec) > small)
{
const vector& sepVec = sepVecs[sVI];
vectorTensorTransform t(sepVec);
if (mag(sepVec) > small)
{
vectorTensorTransform t(sepVec);
label matchTransI;
label sign = matchTransform
(
transforms_,
matchTransI,
t,
cpp.matchTolerance(),
true
);
patchTransformSign_[patchi] =
labelPair(matchTransI, sign);
}
label matchTransI;
label sign = matchTransform
(
transforms_,
matchTransI,
t,
cpp.matchTolerance(),
true
);
patchTransformSign_[patchi] = labelPair(matchTransI, sign);
}
}
else if (!cpp.parallel())
{
const tensorField& transTensors = cpp.reverseT();
const tensor& transT = cpp.reverseT();
// This loop is implicitly expecting only a single
// value for reverseT()
forAll(transTensors, tTI)
if (mag(transT - I) > small)
{
const tensor& transT = transTensors[tTI];
vectorTensorTransform t(transT);
if (mag(transT - I) > small)
{
vectorTensorTransform t(transT);
label matchTransI;
label sign = matchTransform
(
transforms_,
matchTransI,
t,
cpp.matchTolerance(),
true
);
label matchTransI;
label sign = matchTransform
(
transforms_,
matchTransI,
t,
cpp.matchTolerance(),
true
);
patchTransformSign_[patchi] =
labelPair(matchTransI, sign);
}
patchTransformSign_[patchi] = labelPair(matchTransI, sign);
}
}
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -138,7 +138,7 @@ Foam::cyclicFvPatchField<Type>::patchNeighbourField() const
{
pnf[facei] = transform
(
forwardT()[0], iField[nbrFaceCells[facei]]
forwardT(), iField[nbrFaceCells[facei]]
);
}
}

View File

@ -190,13 +190,13 @@ public:
}
//- Return face transformation tensor
virtual const tensorField& forwardT() const
virtual const tensor& forwardT() const
{
return cyclicPatch_.forwardT();
}
//- Return neighbour-cell transformation tensor
virtual const tensorField& reverseT() const
virtual const tensor& reverseT() const
{
return cyclicPatch_.reverseT();
}

View File

@ -196,13 +196,13 @@ public:
}
//- Return face transformation tensor
virtual const tensorField& forwardT() const
virtual const tensor& forwardT() const
{
return cyclicAMIPatch_.forwardT();
}
//- Return neighbour-cell transformation tensor
virtual const tensorField& reverseT() const
virtual const tensor& reverseT() const
{
return cyclicAMIPatch_.reverseT();
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -112,7 +112,7 @@ Foam::jumpCyclicFvPatchField<Type>::patchNeighbourField() const
{
pnf[facei] = transform
(
this->forwardT()[0], iField[nbrFaceCells[facei]]
this->forwardT(), iField[nbrFaceCells[facei]]
) - jf[facei];
}
}

View File

@ -268,7 +268,7 @@ public:
}
//- Return face transformation tensor
virtual const tensorField& forwardT() const
virtual const tensor& forwardT() const
{
return procPatch_.forwardT();
}

View File

@ -161,7 +161,7 @@ public:
}
//- Return face transformation tensor
virtual const tensorField& forwardT() const
virtual const tensor& forwardT() const
{
return procPatch_.forwardT();
}

View File

@ -100,14 +100,14 @@ public:
return coupledPolyPatch_.coupled();
}
//- Are the cyclic planes parallel.
//- Are the cyclic planes parallel
virtual bool parallel() const = 0;
//- Return face transformation tensor.
virtual const tensorField& forwardT() const = 0;
//- Return face transformation tensor
virtual const tensor& forwardT() const = 0;
//- Return neighbour-cell transformation tensor.
virtual const tensorField& reverseT() const = 0;
//- Return neighbour-cell transformation tensor
virtual const tensor& reverseT() const = 0;
//- Return faceCell addressing
virtual const labelUList& faceCells() const

View File

@ -97,7 +97,7 @@ Foam::tmp<Foam::vectorField> Foam::cyclicFvPatch::delta() const
vector ddi = patchD[facei];
vector dni = nbrPatchD[facei];
pdv[facei] = ddi - transform(forwardT()[0], dni);
pdv[facei] = ddi - transform(forwardT(), dni);
}
}

View File

@ -120,13 +120,13 @@ public:
}
//- Return face transformation tensor
virtual const tensorField& forwardT() const
virtual const tensor& forwardT() const
{
return cyclicPolyPatch_.forwardT();
}
//- Return neighbour-cell transformation tensor
virtual const tensorField& reverseT() const
virtual const tensor& reverseT() const
{
return cyclicPolyPatch_.reverseT();
}

View File

@ -156,7 +156,7 @@ Foam::tmp<Foam::vectorField> Foam::cyclicAMIFvPatch::delta() const
const vector& ddi = patchD[facei];
const vector& dni = nbrPatchD[facei];
pdv[facei] = ddi - transform(forwardT()[0], dni);
pdv[facei] = ddi - transform(forwardT(), dni);
}
}

View File

@ -146,13 +146,13 @@ public:
}
//- Return face transformation tensor
virtual const tensorField& forwardT() const
virtual const tensor& forwardT() const
{
return cyclicAMIPolyPatch_.forwardT();
}
//- Return neighbour-cell transformation tensor
virtual const tensorField& reverseT() const
virtual const tensor& reverseT() const
{
return cyclicAMIPolyPatch_.reverseT();
}

View File

@ -133,13 +133,13 @@ public:
}
//- Return face transformation tensor
virtual const tensorField& forwardT() const
virtual const tensor& forwardT() const
{
return procPolyPatch_.forwardT();
}
//- Return neighbour-cell transformation tensor.
virtual const tensorField& reverseT() const
virtual const tensor& reverseT() const
{
return procPolyPatch_.reverseT();
}

View File

@ -92,13 +92,13 @@ public:
}
//- Return face transformation tensor
virtual const tensorField& forwardT() const
virtual const tensor& forwardT() const
{
return procPolyPatch_.forwardT();
}
//- Return neighbour-cell transformation tensor
virtual const tensorField& reverseT() const
virtual const tensor& reverseT() const
{
return procPolyPatch_.reverseT();
}

View File

@ -1069,23 +1069,11 @@ void Foam::particle::correctAfterParallelTransfer
if (!ppp.parallel())
{
const tensor& T =
(
ppp.forwardT().size() == 1
? ppp.forwardT()[0]
: ppp.forwardT()[facei_]
);
transformProperties(T);
transformProperties(ppp.forwardT());
}
else if (ppp.separated())
{
const vector& s =
(
(ppp.separation().size() == 1)
? ppp.separation()[0]
: ppp.separation()[facei_]
);
transformProperties(-s);
transformProperties(-ppp.separation());
}
// Set the topology

View File

@ -280,23 +280,11 @@ void Foam::particle::hitCyclicPatch(TrackCloudType&, trackingData&)
// Transform the properties
if (!receiveCpp.parallel())
{
const tensor& T =
(
receiveCpp.forwardT().size() == 1
? receiveCpp.forwardT()[0]
: receiveCpp.forwardT()[receiveFacei]
);
transformProperties(T);
transformProperties(receiveCpp.forwardT());
}
else if (receiveCpp.separated())
{
const vector& s =
(
(receiveCpp.separation().size() == 1)
? receiveCpp.separation()[0]
: receiveCpp.separation()[receiveFacei]
);
transformProperties(-s);
transformProperties(-receiveCpp.separation());
}
}
@ -388,24 +376,12 @@ void Foam::particle::hitCyclicAMIPatch
if (!receiveCpp.parallel())
{
const tensor& T =
(
receiveCpp.forwardT().size() == 1
? receiveCpp.forwardT()[0]
: receiveCpp.forwardT()[facei_]
);
transformProperties(T);
displacementT = transform(T, displacementT);
transformProperties(receiveCpp.forwardT());
displacementT = transform(receiveCpp.forwardT(), displacementT);
}
else if (receiveCpp.separated())
{
const vector& s =
(
(receiveCpp.separation().size() == 1)
? receiveCpp.separation()[0]
: receiveCpp.separation()[facei_]
);
transformProperties(-s);
transformProperties(-receiveCpp.separation());
}
// If on a boundary and the displacement points into the receiving face

View File

@ -132,13 +132,13 @@ public:
}
//- Return face transformation tensor
virtual const tensorField& forwardT() const
virtual const tensor& forwardT() const
{
return cyclicAMIInterface_.forwardT();
}
//- Return neighbour-cell transformation tensor
virtual const tensorField& reverseT() const
virtual const tensor& reverseT() const
{
return cyclicAMIInterface_.reverseT();
}

View File

@ -142,13 +142,13 @@ public:
}
//- Return face transformation tensor
virtual const tensorField& forwardT() const
virtual const tensor& forwardT() const
{
return fineCyclicAMIInterface_.forwardT();
}
//- Return neighbour-cell transformation tensor
virtual const tensorField& reverseT() const
virtual const tensor& reverseT() const
{
return fineCyclicAMIInterface_.reverseT();
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -88,10 +88,10 @@ public:
AMITransforms() const = 0;
//- Return face transformation tensor
virtual const tensorField& forwardT() const = 0;
virtual const tensor& forwardT() const = 0;
//- Return face reverse transformation tensor
virtual const tensorField& reverseT() const = 0;
virtual const tensor& reverseT() const = 0;
};

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -50,14 +50,7 @@ void Foam::cyclicAMILduInterfaceField::transformCoupleField
{
if (doTransform())
{
if (forwardT().size() == 1)
{
f *= pow(diag(forwardT()[0]).component(cmpt), rank());
}
else
{
f *= pow(diag(forwardT())().component(cmpt), rank());
}
f *= pow(diag(forwardT()).component(cmpt), rank());
}
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -74,10 +74,10 @@ public:
virtual bool doTransform() const = 0;
//- Return face transformation tensor
virtual const tensorField& forwardT() const = 0;
virtual const tensor& forwardT() const = 0;
//- Return neighbour-cell transformation tensor
virtual const tensorField& reverseT() const = 0;
virtual const tensor& reverseT() const = 0;
//- Return rank of component for transform
virtual int rank() const = 0;
@ -112,14 +112,7 @@ void Foam::cyclicAMILduInterfaceField::transformCoupleField
{
if (doTransform())
{
if (forwardT().size() == 1)
{
transform(f, forwardT()[0], f);
}
else
{
transform(f, forwardT(), f);
}
transform(f, forwardT(), f);
}
}

View File

@ -136,13 +136,13 @@ public:
}
//- Return face transformation tensor
const tensorField& forwardT() const
const tensor& forwardT() const
{
return cyclicAMIPolyPatch_.forwardT();
}
//- Return neighbour-cell transformation tensor
const tensorField& reverseT() const
const tensor& reverseT() const
{
return cyclicAMIPolyPatch_.reverseT();
}

View File

@ -154,11 +154,8 @@ void Foam::cyclicAMIPointPatchField<Type>::swapAddSeparated
if (doTransform())
{
const tensor& forwardT = this->forwardT()[0];
const tensor& reverseT = this->reverseT()[0];
transform(ptFld, reverseT, ptFld);
transform(nbrPtFld, forwardT, nbrPtFld);
transform(ptFld, this->reverseT(), ptFld);
transform(nbrPtFld, this->forwardT(), nbrPtFld);
}
// convert point field to face field, AMI interpolate, then

View File

@ -194,13 +194,13 @@ public:
}
//- Return face transformation tensor
virtual const tensorField& forwardT() const
virtual const tensor& forwardT() const
{
return cyclicAMIPatch_.forwardT();
}
//- Return neighbour-cell transformation tensor
virtual const tensorField& reverseT() const
virtual const tensor& reverseT() const
{
return cyclicAMIPatch_.reverseT();
}

View File

@ -227,10 +227,11 @@ void Foam::cyclicAMIPolyPatch::calcTransforms
}
}
const_cast<tensorField&>(forwardT()) = tensorField(1, revT.T());
const_cast<tensorField&>(reverseT()) = tensorField(1, revT);
const_cast<vectorField&>(separation()).setSize(0);
const_cast<boolList&>(collocated()) = boolList(1, false);
parallel_ = false;
separated_ = false;
separation_ = Zero;
forwardT_ = revT.T();
reverseT_ = revT;
break;
}
@ -243,14 +244,11 @@ void Foam::cyclicAMIPolyPatch::calcTransforms
<< endl;
}
const_cast<tensorField&>(forwardT()).clear();
const_cast<tensorField&>(reverseT()).clear();
const_cast<vectorField&>(separation()) = vectorField
(
1,
separationVector_
);
const_cast<boolList&>(collocated()) = boolList(1, false);
parallel_ = true;
separated_ = true;
separation_ = separationVector_;
forwardT_ = Zero;
reverseT_ = Zero;
break;
}
@ -262,10 +260,11 @@ void Foam::cyclicAMIPolyPatch::calcTransforms
<< " Assuming cyclic AMI pairs are colocated" << endl;
}
const_cast<tensorField&>(forwardT()).clear();
const_cast<tensorField&>(reverseT()).clear();
const_cast<vectorField&>(separation()).setSize(0);
const_cast<boolList&>(collocated()) = boolList(1, true);
parallel_ = true;
separated_ = false;
separation_ = Zero;
forwardT_ = Zero;
reverseT_ = Zero;
break;
}
@ -276,8 +275,7 @@ void Foam::cyclicAMIPolyPatch::calcTransforms
Pout<< "patch: " << name() << nl
<< " forwardT = " << forwardT() << nl
<< " reverseT = " << reverseT() << nl
<< " separation = " << separation() << nl
<< " collocated = " << collocated() << nl << endl;
<< " separation = " << separation() << nl << endl;
}
}
@ -387,8 +385,7 @@ void Foam::cyclicAMIPolyPatch::calcTransforms()
Pout<< "calcTransforms() : patch: " << name() << nl
<< " forwardT = " << forwardT() << nl
<< " reverseT = " << reverseT() << nl
<< " separation = " << separation() << nl
<< " collocated = " << collocated() << nl << endl;
<< " separation = " << separation() << nl << endl;
}
}
@ -897,19 +894,7 @@ void Foam::cyclicAMIPolyPatch::transformPosition(pointField& l) const
{
// transformPosition gets called on the receiving side,
// separation gets calculated on the sending side so subtract
const vectorField& s = separation();
if (s.size() == 1)
{
forAll(l, i)
{
l[i] -= s[0];
}
}
else
{
l -= s;
}
l -= separation();
}
}
@ -922,32 +907,19 @@ void Foam::cyclicAMIPolyPatch::transformPosition
{
if (!parallel())
{
const tensor& T =
(
forwardT().size() == 1
? forwardT()[0]
: forwardT()[facei]
);
if (transform() == ROTATIONAL)
{
l = Foam::transform(T, l - rotationCentre_) + rotationCentre_;
l = Foam::transform(forwardT(), l - rotationCentre_)
+ rotationCentre_;
}
else
{
l = Foam::transform(T, l);
l = Foam::transform(forwardT(), l);
}
}
else if (separated())
{
const vector& s =
(
separation().size() == 1
? separation()[0]
: separation()[facei]
);
l -= s;
l -= separation();
}
}
@ -960,14 +932,7 @@ void Foam::cyclicAMIPolyPatch::transformDirection
{
if (!parallel())
{
const tensor& T =
(
forwardT().size() == 1
? forwardT()[0]
: forwardT()[facei]
);
d = Foam::transform(T, d);
d = Foam::transform(forwardT(), d);
}
}
@ -980,32 +945,19 @@ void Foam::cyclicAMIPolyPatch::reverseTransformPosition
{
if (!parallel())
{
const tensor& T =
(
reverseT().size() == 1
? reverseT()[0]
: reverseT()[facei]
);
if (transform() == ROTATIONAL)
{
l = Foam::transform(T, l - rotationCentre_) + rotationCentre_;
l = Foam::transform(reverseT(), l - rotationCentre_)
+ rotationCentre_;
}
else
{
l = Foam::transform(T, l);
l = Foam::transform(reverseT(), l);
}
}
else if (separated())
{
const vector& s =
(
separation().size() == 1
? separation()[0]
: separation()[facei]
);
l += s;
l += separation();
}
}
@ -1018,14 +970,7 @@ void Foam::cyclicAMIPolyPatch::reverseTransformDirection
{
if (!parallel())
{
const tensor& T =
(
reverseT().size() == 1
? reverseT()[0]
: reverseT()[facei]
);
d = Foam::transform(T, d);
d = Foam::transform(reverseT(), d);
}
}

View File

@ -100,31 +100,18 @@ void Foam::cyclicRepeatAMIPolyPatch::resetAMI() const
<< "This is not allowed." << exit(FatalError);
}
if
(
transformPatch.separation().size() > 1
|| transformPatch.forwardT().size() > 1
)
{
FatalErrorInFunction
<< "Transform patch " << transformPatch.name() << " for "
<< typeName << " patch " << name() << " has a non-uniform "
<< "transformation. This is not allowed."
<< exit(FatalError);
}
Tuple2<bool, vectorTensorTransform> bt
(
transformPatch.size(),
vectorTensorTransform
(
transformPatch.separation().size() > 0
? transformPatch.separation()[0]
transformPatch.separated()
? transformPatch.separation()
: vector::zero,
transformPatch.forwardT().size() > 0
? transformPatch.forwardT()[0]
!transformPatch.parallel()
? transformPatch.forwardT()
: tensor::zero,
transformPatch.forwardT().size() > 0
!transformPatch.parallel()
)
);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -457,28 +457,14 @@ void Foam::FaceCellWave<Type, TrackingData>::enterDomain
template<class Type, class TrackingData>
void Foam::FaceCellWave<Type, TrackingData>::transform
(
const tensorField& rotTensor,
const tensor& rotTensor,
const label nFaces,
List<Type>& faceInfo
)
{
// Transform. Implementation referred to Type
if (rotTensor.size() == 1)
for (label facei = 0; facei < nFaces; facei++)
{
const tensor& T = rotTensor[0];
for (label facei = 0; facei < nFaces; facei++)
{
faceInfo[facei].transform(mesh_, T, td_);
}
}
else
{
for (label facei = 0; facei < nFaces; facei++)
{
faceInfo[facei].transform(mesh_, rotTensor[facei], td_);
}
faceInfo[facei].transform(mesh_, rotTensor, td_);
}
}

View File

@ -215,7 +215,7 @@ protected:
//- Apply transformation to Type
void transform
(
const tensorField& rotTensor,
const tensor& rotTensor,
const label nFaces,
List<Type>& faceInfo
);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -119,31 +119,13 @@ template<class Type, class TrackingData>
void Foam::PointEdgeWave<Type, TrackingData>::transform
(
const polyPatch& patch,
const tensorField& rotTensor,
const tensor& rotTensor,
List<Type>& pointInfo
) const
{
if (rotTensor.size() == 1)
forAll(pointInfo, i)
{
const tensor& T = rotTensor[0];
forAll(pointInfo, i)
{
pointInfo[i].transform(T, td_);
}
}
else
{
FatalErrorInFunction
<< "Non-uniform transformation on patch " << patch.name()
<< " of type " << patch.type()
<< " not supported for point fields"
<< abort(FatalError);
forAll(pointInfo, i)
{
pointInfo[i].transform(rotTensor[i], td_);
}
pointInfo[i].transform(rotTensor, td_);
}
}

View File

@ -160,7 +160,7 @@ class PointEdgeWave
void transform
(
const polyPatch& patch,
const tensorField& rotTensor,
const tensor& rotTensor,
List<Type>& pointInfo
) const;