coupledPolyPatch:transform() -> transformType()
to facilitate the change to using the transformer class.
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -776,7 +776,11 @@ int main(int argc, char *argv[])
|
||||
const cyclicPolyPatch& cycpp =
|
||||
refCast<const cyclicPolyPatch>(pp);
|
||||
|
||||
if (cycpp.transform() != cyclicPolyPatch::TRANSLATIONAL)
|
||||
if
|
||||
(
|
||||
cycpp.transformType()
|
||||
!= cyclicPolyPatch::TRANSLATIONAL
|
||||
)
|
||||
{
|
||||
const cyclicPolyPatch& nbr = cycpp.neighbPatch();
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -48,7 +48,7 @@ namespace Foam
|
||||
coupledPolyPatch::orderingTypeNames;
|
||||
|
||||
template<>
|
||||
const char* NamedEnum<coupledPolyPatch::transformType, 4>::names[] =
|
||||
const char* NamedEnum<coupledPolyPatch::transformTypes, 4>::names[] =
|
||||
{
|
||||
"unspecified",
|
||||
"none",
|
||||
@ -56,7 +56,7 @@ namespace Foam
|
||||
"translational"
|
||||
};
|
||||
|
||||
const NamedEnum<coupledPolyPatch::transformType, 4>
|
||||
const NamedEnum<coupledPolyPatch::transformTypes, 4>
|
||||
coupledPolyPatch::transformTypeNames;
|
||||
}
|
||||
|
||||
@ -315,7 +315,7 @@ Foam::coupledPolyPatch::coupledPolyPatch
|
||||
polyPatch(name, size, start, index, bm, patchType),
|
||||
matchTolerance_(defaultMatchTol_),
|
||||
ordering_(ordering),
|
||||
transform_(UNSPECIFIED),
|
||||
transformType_(UNSPECIFIED),
|
||||
parallel_(true),
|
||||
separated_(false)
|
||||
{}
|
||||
@ -339,10 +339,10 @@ Foam::coupledPolyPatch::coupledPolyPatch
|
||||
? orderingTypeNames.read(dict.lookup("ordering"))
|
||||
: ordering
|
||||
),
|
||||
transform_
|
||||
transformType_
|
||||
(
|
||||
dict.found("transform")
|
||||
? transformTypeNames.read(dict.lookup("transform"))
|
||||
dict.found("transformType")
|
||||
? transformTypeNames.read(dict.lookup("transformType"))
|
||||
: UNSPECIFIED
|
||||
),
|
||||
parallel_(true),
|
||||
@ -358,7 +358,7 @@ Foam::coupledPolyPatch::coupledPolyPatch
|
||||
:
|
||||
polyPatch(pp, bm),
|
||||
matchTolerance_(pp.matchTolerance_),
|
||||
transform_(pp.transform_),
|
||||
transformType_(pp.transformType_),
|
||||
parallel_(true),
|
||||
separated_(false)
|
||||
{}
|
||||
@ -375,7 +375,7 @@ Foam::coupledPolyPatch::coupledPolyPatch
|
||||
:
|
||||
polyPatch(pp, bm, index, newSize, newStart),
|
||||
matchTolerance_(pp.matchTolerance_),
|
||||
transform_(pp.transform_),
|
||||
transformType_(pp.transformType_),
|
||||
parallel_(true),
|
||||
separated_(false)
|
||||
{}
|
||||
@ -392,7 +392,7 @@ Foam::coupledPolyPatch::coupledPolyPatch
|
||||
:
|
||||
polyPatch(pp, bm, index, mapAddressing, newStart),
|
||||
matchTolerance_(pp.matchTolerance_),
|
||||
transform_(pp.transform_),
|
||||
transformType_(pp.transformType_),
|
||||
parallel_(true),
|
||||
separated_(false)
|
||||
{}
|
||||
@ -411,7 +411,7 @@ void Foam::coupledPolyPatch::write(Ostream& os) const
|
||||
polyPatch::write(os);
|
||||
writeEntry(os, "matchTolerance", matchTolerance_);
|
||||
writeEntry(os, "ordering", orderingTypeNames[ordering_]);
|
||||
writeEntry(os, "transform", transformTypeNames[transform_]);
|
||||
writeEntry(os, "transformType", transformTypeNames[transformType_]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -65,7 +65,7 @@ public:
|
||||
|
||||
static const NamedEnum<orderingType, 3> orderingTypeNames;
|
||||
|
||||
enum transformType
|
||||
enum transformTypes
|
||||
{
|
||||
UNSPECIFIED, // Unspecified -> automatic transformation
|
||||
NONE, // No tranformation
|
||||
@ -73,7 +73,7 @@ public:
|
||||
TRANSLATIONAL // Translation
|
||||
};
|
||||
|
||||
static const NamedEnum<transformType, 4> transformTypeNames;
|
||||
static const NamedEnum<transformTypes, 4> transformTypeNames;
|
||||
|
||||
|
||||
protected:
|
||||
@ -90,7 +90,7 @@ protected:
|
||||
orderingType ordering_;
|
||||
|
||||
//- Type of transformation
|
||||
transformType transform_;
|
||||
transformTypes transformType_;
|
||||
|
||||
//- Are coupled patches parallel
|
||||
mutable bool parallel_;
|
||||
@ -259,9 +259,9 @@ public:
|
||||
}
|
||||
|
||||
//- Type of transform
|
||||
virtual transformType transform() const
|
||||
virtual transformTypes transformType() const
|
||||
{
|
||||
return transform_;
|
||||
return transformType_;
|
||||
}
|
||||
|
||||
//- Transform a patch-based position from other side to this side
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -58,7 +58,7 @@ void Foam::cyclicPolyPatch::calcTransformTensors
|
||||
const scalarField& smallDist,
|
||||
const scalar absTol,
|
||||
const orderingType ordering,
|
||||
const transformType transform
|
||||
const transformTypes transform
|
||||
) const
|
||||
{
|
||||
if (debug)
|
||||
@ -328,14 +328,14 @@ void Foam::cyclicPolyPatch::calcTransforms
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
if (transform() != neighbPatch().transform())
|
||||
if (transformType() != neighbPatch().transformType())
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Patch " << name()
|
||||
<< " has transform type " << transformTypeNames[transform()]
|
||||
<< " has transform type " << transformTypeNames[transformType()]
|
||||
<< ", neighbour patch " << neighbPatchName()
|
||||
<< " has transform type "
|
||||
<< neighbPatch().transformTypeNames[neighbPatch().transform()]
|
||||
<< neighbPatch().transformTypeNames[neighbPatch().transformType()]
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
@ -421,7 +421,7 @@ void Foam::cyclicPolyPatch::calcTransforms
|
||||
|
||||
// Calculate transformation
|
||||
|
||||
if (transform() == ROTATIONAL)
|
||||
if (transformType() == ROTATIONAL)
|
||||
{
|
||||
// Calculate using the given rotation axis and centre. Do not
|
||||
// use calculated normals.
|
||||
@ -464,7 +464,7 @@ void Foam::cyclicPolyPatch::calcTransforms
|
||||
forwardT_ = revT.T();
|
||||
reverseT_ = revT;
|
||||
}
|
||||
else if (transform() == TRANSLATIONAL)
|
||||
else if (transformType() == TRANSLATIONAL)
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
@ -530,7 +530,7 @@ void Foam::cyclicPolyPatch::calcTransforms
|
||||
half0Tols,
|
||||
matchTolerance(),
|
||||
ordering(),
|
||||
transform()
|
||||
transformType()
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -565,7 +565,7 @@ void Foam::cyclicPolyPatch::getCentresAndAnchors
|
||||
|
||||
if (half0Ctrs.size())
|
||||
{
|
||||
switch (transform())
|
||||
switch (transformType())
|
||||
{
|
||||
case ROTATIONAL:
|
||||
{
|
||||
@ -827,7 +827,7 @@ Foam::cyclicPolyPatch::cyclicPolyPatch
|
||||
<< exit(FatalIOError);
|
||||
}
|
||||
|
||||
switch (transform())
|
||||
switch (transformType())
|
||||
{
|
||||
case ROTATIONAL:
|
||||
{
|
||||
@ -997,7 +997,7 @@ void Foam::cyclicPolyPatch::transformPosition(pointField& l) const
|
||||
{
|
||||
if (!parallel())
|
||||
{
|
||||
if (transform() == ROTATIONAL)
|
||||
if (transformType() == ROTATIONAL)
|
||||
{
|
||||
l =
|
||||
Foam::transform(forwardT(), l-rotationCentre_)
|
||||
@ -1021,7 +1021,7 @@ void Foam::cyclicPolyPatch::transformPosition(point& l, const label facei) const
|
||||
{
|
||||
if (!parallel())
|
||||
{
|
||||
if (transform() == ROTATIONAL)
|
||||
if (transformType() == ROTATIONAL)
|
||||
{
|
||||
l = Foam::transform(forwardT(), l - rotationCentre_)
|
||||
+ rotationCentre_;
|
||||
@ -1567,7 +1567,7 @@ void Foam::cyclicPolyPatch::write(Ostream& os) const
|
||||
writeEntry(os, "neighbourPatch", neighbPatchName_);
|
||||
}
|
||||
coupleGroup_.write(os);
|
||||
switch (transform())
|
||||
switch (transformType())
|
||||
{
|
||||
case ROTATIONAL:
|
||||
{
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -114,7 +114,7 @@ class cyclicPolyPatch
|
||||
const scalarField& smallDist,
|
||||
const scalar absTol,
|
||||
const orderingType = UNKNOWN,
|
||||
const transformType = UNSPECIFIED
|
||||
const transformTypes = UNSPECIFIED
|
||||
) const;
|
||||
|
||||
//- Find amongst selected faces the one with the largest area
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -301,7 +301,7 @@ void Foam::oldCyclicPolyPatch::getCentresAndAnchors
|
||||
anchors0 = getAnchorPoints(half0Faces, pp.points());
|
||||
half1Ctrs = calcFaceCentres(half1Faces, pp.points());
|
||||
|
||||
switch (transform())
|
||||
switch (transformType())
|
||||
{
|
||||
case ROTATIONAL:
|
||||
{
|
||||
@ -586,7 +586,7 @@ Foam::oldCyclicPolyPatch::oldCyclicPolyPatch
|
||||
|
||||
dict.readIfPresent("featureCos", featureCos_);
|
||||
|
||||
switch (transform())
|
||||
switch (transformType())
|
||||
{
|
||||
case ROTATIONAL:
|
||||
{
|
||||
@ -1205,7 +1205,7 @@ void Foam::oldCyclicPolyPatch::write(Ostream& os) const
|
||||
|
||||
|
||||
writeEntry(os, "featureCos", featureCos_);
|
||||
switch (transform())
|
||||
switch (transformType())
|
||||
{
|
||||
case ROTATIONAL:
|
||||
{
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -248,7 +248,7 @@ void Foam::processorCyclicPolyPatch::calcGeometry(PstreamBuffers& pBufs)
|
||||
matchTolerance()*calcFaceTol(*this, points(), faceCentres()),
|
||||
matchTolerance(),
|
||||
ordering(),
|
||||
transform()
|
||||
transformType()
|
||||
);
|
||||
|
||||
// Where do we store the calculated transformation?
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -321,9 +321,9 @@ public:
|
||||
}
|
||||
|
||||
//- Type of transform
|
||||
virtual transformType transform() const
|
||||
virtual transformTypes transformType() const
|
||||
{
|
||||
return referPatch().transform();
|
||||
return referPatch().transformType();
|
||||
}
|
||||
|
||||
//- Transform a patch-based position from other side to this side
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -77,21 +77,21 @@ void Foam::cyclicAMIPolyPatch::calcTransforms
|
||||
const vectorField& half1Areas
|
||||
)
|
||||
{
|
||||
if (transform() != neighbPatch().transform())
|
||||
if (transformType() != neighbPatch().transformType())
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Patch " << name()
|
||||
<< " has transform type " << transformTypeNames[transform()]
|
||||
<< " has transform type " << transformTypeNames[transformType()]
|
||||
<< ", neighbour patch " << neighbPatchName()
|
||||
<< " has transform type "
|
||||
<< neighbPatch().transformTypeNames[neighbPatch().transform()]
|
||||
<< neighbPatch().transformTypeNames[neighbPatch().transformType()]
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
|
||||
// Calculate transformation tensors
|
||||
|
||||
switch (transform())
|
||||
switch (transformType())
|
||||
{
|
||||
case ROTATIONAL:
|
||||
{
|
||||
@ -560,7 +560,7 @@ Foam::cyclicAMIPolyPatch::cyclicAMIPolyPatch
|
||||
<< exit(FatalIOError);
|
||||
}
|
||||
|
||||
switch (transform())
|
||||
switch (transformType())
|
||||
{
|
||||
case ROTATIONAL:
|
||||
{
|
||||
@ -874,7 +874,7 @@ void Foam::cyclicAMIPolyPatch::transformPosition(pointField& l) const
|
||||
{
|
||||
if (!parallel())
|
||||
{
|
||||
if (transform() == ROTATIONAL)
|
||||
if (transformType() == ROTATIONAL)
|
||||
{
|
||||
l = Foam::transform(forwardT(), l - rotationCentre_)
|
||||
+ rotationCentre_;
|
||||
@ -901,7 +901,7 @@ void Foam::cyclicAMIPolyPatch::transformPosition
|
||||
{
|
||||
if (!parallel())
|
||||
{
|
||||
if (transform() == ROTATIONAL)
|
||||
if (transformType() == ROTATIONAL)
|
||||
{
|
||||
l = Foam::transform(forwardT(), l - rotationCentre_)
|
||||
+ rotationCentre_;
|
||||
@ -939,7 +939,7 @@ void Foam::cyclicAMIPolyPatch::reverseTransformPosition
|
||||
{
|
||||
if (!parallel())
|
||||
{
|
||||
if (transform() == ROTATIONAL)
|
||||
if (transformType() == ROTATIONAL)
|
||||
{
|
||||
l = Foam::transform(reverseT(), l - rotationCentre_)
|
||||
+ rotationCentre_;
|
||||
@ -1144,7 +1144,7 @@ void Foam::cyclicAMIPolyPatch::write(Ostream& os) const
|
||||
}
|
||||
coupleGroup_.write(os);
|
||||
|
||||
switch (transform())
|
||||
switch (transformType())
|
||||
{
|
||||
case ROTATIONAL:
|
||||
{
|
||||
|
||||
@ -122,7 +122,7 @@ boundary
|
||||
{
|
||||
type cyclic;
|
||||
neighbourPatch cyclic_half1;
|
||||
transform rotational;
|
||||
transformType rotational;
|
||||
rotationAxis (0 0 1);
|
||||
rotationCentre (0 0 0);
|
||||
faces
|
||||
@ -135,7 +135,7 @@ boundary
|
||||
{
|
||||
type cyclic;
|
||||
neighbourPatch cyclic_half0;
|
||||
transform rotational;
|
||||
transformType rotational;
|
||||
rotationAxis (0 0 1);
|
||||
rotationCentre (0 0 0);
|
||||
faces
|
||||
|
||||
@ -84,7 +84,7 @@ boundary
|
||||
(0 1 5 4)
|
||||
);
|
||||
|
||||
transform rotational;
|
||||
transformType rotational;
|
||||
rotationAxis (1 0 0);
|
||||
rotationCentre (0 0 0);
|
||||
}
|
||||
@ -98,7 +98,7 @@ boundary
|
||||
(7 6 2 3)
|
||||
);
|
||||
|
||||
transform rotational;
|
||||
transformType rotational;
|
||||
rotationAxis (1 0 0);
|
||||
rotationCentre (0 0 0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user