topoSet: Renamed point entries for cylinder sources
End points of topoSet cylinder sources should now be specified as "point1" and "point2", which is consistent with other parts of the code. The previous keywords, "p1" and "p2" have been retained for backwards compatibility but may be removed in future.
This commit is contained in:
@ -118,8 +118,8 @@ FoamFile
|
||||
// source cylinderToCell;
|
||||
// sourceInfo
|
||||
// {
|
||||
// p1 (0.2 0.2 -10); // start point on cylinder axis
|
||||
// p2 (0.2 0.2 0); // end point on cylinder axis
|
||||
// point1 (0.2 0.2 -10); // start point on cylinder axis
|
||||
// point2 (0.2 0.2 0); // end point on cylinder axis
|
||||
// radius 5.0;
|
||||
// }
|
||||
//
|
||||
|
||||
@ -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-2021 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -40,8 +40,8 @@ namespace Foam
|
||||
Foam::topoSetSource::addToUsageTable Foam::cylinderAnnulusToCell::usage_
|
||||
(
|
||||
cylinderAnnulusToCell::typeName,
|
||||
"\n Usage: cylinderAnnulusToCell (p1X p1Y p1Z) (p2X p2Y p2Z)"
|
||||
" outerRadius innerRadius\n\n"
|
||||
"\n Usage: cylinderAnnulusToCell (point1X point1Y point1Z)"
|
||||
" (point2X point2Y point2Z) outerRadius innerRadius\n\n"
|
||||
" Select all cells with cell centre within bounding cylinder annulus\n\n"
|
||||
);
|
||||
|
||||
@ -50,7 +50,7 @@ Foam::topoSetSource::addToUsageTable Foam::cylinderAnnulusToCell::usage_
|
||||
|
||||
void Foam::cylinderAnnulusToCell::combine(topoSet& set, const bool add) const
|
||||
{
|
||||
const vector axis = p2_ - p1_;
|
||||
const vector axis = point2_ - point1_;
|
||||
const scalar orad2 = sqr(outerRadius_);
|
||||
const scalar irad2 = sqr(innerRadius_);
|
||||
const scalar magAxis2 = magSqr(axis);
|
||||
@ -59,7 +59,7 @@ void Foam::cylinderAnnulusToCell::combine(topoSet& set, const bool add) const
|
||||
|
||||
forAll(ctrs, celli)
|
||||
{
|
||||
vector d = ctrs[celli] - p1_;
|
||||
vector d = ctrs[celli] - point1_;
|
||||
scalar magD = d & axis;
|
||||
|
||||
if ((magD > 0) && (magD < magAxis2))
|
||||
@ -79,15 +79,15 @@ void Foam::cylinderAnnulusToCell::combine(topoSet& set, const bool add) const
|
||||
Foam::cylinderAnnulusToCell::cylinderAnnulusToCell
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const vector& p1,
|
||||
const vector& p2,
|
||||
const vector& point1,
|
||||
const vector& point2,
|
||||
const scalar outerRadius,
|
||||
const scalar innerRadius
|
||||
)
|
||||
:
|
||||
topoSetSource(mesh),
|
||||
p1_(p1),
|
||||
p2_(p2),
|
||||
point1_(point1),
|
||||
point2_(point2),
|
||||
outerRadius_(outerRadius),
|
||||
innerRadius_(innerRadius)
|
||||
{}
|
||||
@ -100,8 +100,8 @@ Foam::cylinderAnnulusToCell::cylinderAnnulusToCell
|
||||
)
|
||||
:
|
||||
topoSetSource(mesh),
|
||||
p1_(dict.lookup("p1")),
|
||||
p2_(dict.lookup("p2")),
|
||||
point1_(dict.lookupBackwardsCompatible<point>({"point1", "p1"})),
|
||||
point2_(dict.lookupBackwardsCompatible<point>({"point2", "p2"})),
|
||||
outerRadius_(dict.lookup<scalar>("outerRadius")),
|
||||
innerRadius_(dict.lookup<scalar>("innerRadius"))
|
||||
{}
|
||||
@ -114,8 +114,8 @@ Foam::cylinderAnnulusToCell::cylinderAnnulusToCell
|
||||
)
|
||||
:
|
||||
topoSetSource(mesh),
|
||||
p1_(checkIs(is)),
|
||||
p2_(checkIs(is)),
|
||||
point1_(checkIs(is)),
|
||||
point2_(checkIs(is)),
|
||||
outerRadius_(readScalar(checkIs(is))),
|
||||
innerRadius_(readScalar(checkIs(is)))
|
||||
{}
|
||||
@ -138,19 +138,17 @@ void Foam::cylinderAnnulusToCell::applyToSet
|
||||
if ((action == topoSetSource::NEW) || (action == topoSetSource::ADD))
|
||||
{
|
||||
Info<< " Adding cells with centre within cylinder annulus,"
|
||||
<< " with p1 = "
|
||||
<< p1_ << ", p2 = " << p2_ << " and outer radius = " << outerRadius_
|
||||
<< " and inner radius = " << innerRadius_
|
||||
<< endl;
|
||||
<< " with point1 = "
|
||||
<< point1_ << ", point2 = " << point2_ << " and outer radius = "
|
||||
<< outerRadius_ << " and inner radius = " << innerRadius_ << endl;
|
||||
|
||||
combine(set, true);
|
||||
}
|
||||
else if (action == topoSetSource::DELETE)
|
||||
{
|
||||
Info<< " Removing cells with centre within cylinder, with p1 = "
|
||||
<< p1_ << ", p2 = " << p2_ << " and outer radius = " << outerRadius_
|
||||
<< " and inner radius " << innerRadius_
|
||||
<< endl;
|
||||
Info<< " Removing cells with centre within cylinder, with point1 = "
|
||||
<< point1_ << ", point2 = " << point2_ << " and outer radius = "
|
||||
<< outerRadius_ << " and inner radius " << innerRadius_ << endl;
|
||||
|
||||
combine(set, false);
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -58,10 +58,10 @@ class cylinderAnnulusToCell
|
||||
static addToUsageTable usage_;
|
||||
|
||||
//- First point on cylinder axis
|
||||
vector p1_;
|
||||
vector point1_;
|
||||
|
||||
//- Second point on cylinder axis
|
||||
vector p2_;
|
||||
vector point2_;
|
||||
|
||||
//- Outer Radius
|
||||
scalar outerRadius_;
|
||||
@ -87,8 +87,8 @@ public:
|
||||
cylinderAnnulusToCell
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const vector& p1,
|
||||
const vector& p2,
|
||||
const vector& point1,
|
||||
const vector& point2,
|
||||
const scalar outerRadius,
|
||||
const scalar innerRadius
|
||||
);
|
||||
|
||||
@ -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-2021 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -40,7 +40,8 @@ namespace Foam
|
||||
Foam::topoSetSource::addToUsageTable Foam::cylinderToCell::usage_
|
||||
(
|
||||
cylinderToCell::typeName,
|
||||
"\n Usage: cylinderToCell (p1X p1Y p1Z) (p2X p2Y p2Z) radius\n\n"
|
||||
"\n Usage: cylinderToCell (point1X point1Y point1Z)"
|
||||
" (point2X point2Y point2Z) radius\n\n"
|
||||
" Select all cells with cell centre within bounding cylinder\n\n"
|
||||
);
|
||||
|
||||
@ -49,7 +50,7 @@ Foam::topoSetSource::addToUsageTable Foam::cylinderToCell::usage_
|
||||
|
||||
void Foam::cylinderToCell::combine(topoSet& set, const bool add) const
|
||||
{
|
||||
const vector axis = p2_ - p1_;
|
||||
const vector axis = point2_ - point1_;
|
||||
const scalar rad2 = sqr(radius_);
|
||||
const scalar magAxis2 = magSqr(axis);
|
||||
|
||||
@ -57,7 +58,7 @@ void Foam::cylinderToCell::combine(topoSet& set, const bool add) const
|
||||
|
||||
forAll(ctrs, celli)
|
||||
{
|
||||
vector d = ctrs[celli] - p1_;
|
||||
vector d = ctrs[celli] - point1_;
|
||||
scalar magD = d & axis;
|
||||
|
||||
if ((magD > 0) && (magD < magAxis2))
|
||||
@ -77,14 +78,14 @@ void Foam::cylinderToCell::combine(topoSet& set, const bool add) const
|
||||
Foam::cylinderToCell::cylinderToCell
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const vector& p1,
|
||||
const vector& p2,
|
||||
const vector& point1,
|
||||
const vector& point2,
|
||||
const scalar radius
|
||||
)
|
||||
:
|
||||
topoSetSource(mesh),
|
||||
p1_(p1),
|
||||
p2_(p2),
|
||||
point1_(point1),
|
||||
point2_(point2),
|
||||
radius_(radius)
|
||||
{}
|
||||
|
||||
@ -96,8 +97,8 @@ Foam::cylinderToCell::cylinderToCell
|
||||
)
|
||||
:
|
||||
topoSetSource(mesh),
|
||||
p1_(dict.lookup("p1")),
|
||||
p2_(dict.lookup("p2")),
|
||||
point1_(dict.lookupBackwardsCompatible<point>({"point1", "p1"})),
|
||||
point2_(dict.lookupBackwardsCompatible<point>({"point2", "p2"})),
|
||||
radius_(dict.lookup<scalar>("radius"))
|
||||
{}
|
||||
|
||||
@ -109,8 +110,8 @@ Foam::cylinderToCell::cylinderToCell
|
||||
)
|
||||
:
|
||||
topoSetSource(mesh),
|
||||
p1_(checkIs(is)),
|
||||
p2_(checkIs(is)),
|
||||
point1_(checkIs(is)),
|
||||
point2_(checkIs(is)),
|
||||
radius_(readScalar(checkIs(is)))
|
||||
{}
|
||||
|
||||
@ -131,15 +132,17 @@ void Foam::cylinderToCell::applyToSet
|
||||
{
|
||||
if ((action == topoSetSource::NEW) || (action == topoSetSource::ADD))
|
||||
{
|
||||
Info<< " Adding cells with centre within cylinder, with p1 = "
|
||||
<< p1_ << ", p2 = " << p2_ << " and radius = " << radius_ << endl;
|
||||
Info<< " Adding cells with centre within cylinder, with point1 = "
|
||||
<< point1_ << ", point2 = " << point2_ << " and radius = "
|
||||
<< radius_ << endl;
|
||||
|
||||
combine(set, true);
|
||||
}
|
||||
else if (action == topoSetSource::DELETE)
|
||||
{
|
||||
Info<< " Removing cells with centre within cylinder, with p1 = "
|
||||
<< p1_ << ", p2 = " << p2_ << " and radius = " << radius_ << endl;
|
||||
Info<< " Removing cells with centre within cylinder, with point1 = "
|
||||
<< point1_ << ", point2 = " << point2_ << " and radius = "
|
||||
<< radius_ << endl;
|
||||
|
||||
combine(set, false);
|
||||
}
|
||||
|
||||
@ -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-2021 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -57,10 +57,10 @@ class cylinderToCell
|
||||
static addToUsageTable usage_;
|
||||
|
||||
//- First point on cylinder axis
|
||||
vector p1_;
|
||||
vector point1_;
|
||||
|
||||
//- Second point on cylinder axis
|
||||
vector p2_;
|
||||
vector point2_;
|
||||
|
||||
//- Radius
|
||||
scalar radius_;
|
||||
@ -83,8 +83,8 @@ public:
|
||||
cylinderToCell
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const vector& p1,
|
||||
const vector& p2,
|
||||
const vector& point1,
|
||||
const vector& point2,
|
||||
const scalar radius
|
||||
);
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2017-2019 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2017-2021 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -40,8 +40,8 @@ namespace Foam
|
||||
Foam::topoSetSource::addToUsageTable Foam::cylinderAnnulusToFace::usage_
|
||||
(
|
||||
cylinderAnnulusToFace::typeName,
|
||||
"\n Usage: cylinderAnnulusToFace (p1X p1Y p1Z) (p2X p2Y p2Z)"
|
||||
" outerRadius innerRadius\n\n"
|
||||
"\n Usage: cylinderAnnulusToFace (point1X point1Y point1Z)"
|
||||
" (point2X point2Y point2Z) outerRadius innerRadius\n\n"
|
||||
" Select all faces with face centre within bounding cylinder annulus\n\n"
|
||||
);
|
||||
|
||||
@ -50,7 +50,7 @@ Foam::topoSetSource::addToUsageTable Foam::cylinderAnnulusToFace::usage_
|
||||
|
||||
void Foam::cylinderAnnulusToFace::combine(topoSet& set, const bool add) const
|
||||
{
|
||||
const vector axis = p2_ - p1_;
|
||||
const vector axis = point2_ - point1_;
|
||||
const scalar orad2 = sqr(outerRadius_);
|
||||
const scalar irad2 = sqr(innerRadius_);
|
||||
const scalar magAxis2 = magSqr(axis);
|
||||
@ -59,7 +59,7 @@ void Foam::cylinderAnnulusToFace::combine(topoSet& set, const bool add) const
|
||||
|
||||
forAll(ctrs, facei)
|
||||
{
|
||||
vector d = ctrs[facei] - p1_;
|
||||
vector d = ctrs[facei] - point1_;
|
||||
scalar magD = d & axis;
|
||||
|
||||
if ((magD > 0) && (magD < magAxis2))
|
||||
@ -79,15 +79,15 @@ void Foam::cylinderAnnulusToFace::combine(topoSet& set, const bool add) const
|
||||
Foam::cylinderAnnulusToFace::cylinderAnnulusToFace
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const vector& p1,
|
||||
const vector& p2,
|
||||
const vector& point1,
|
||||
const vector& point2,
|
||||
const scalar outerRadius,
|
||||
const scalar innerRadius
|
||||
)
|
||||
:
|
||||
topoSetSource(mesh),
|
||||
p1_(p1),
|
||||
p2_(p2),
|
||||
point1_(point1),
|
||||
point2_(point2),
|
||||
outerRadius_(outerRadius),
|
||||
innerRadius_(innerRadius)
|
||||
{}
|
||||
@ -100,8 +100,8 @@ Foam::cylinderAnnulusToFace::cylinderAnnulusToFace
|
||||
)
|
||||
:
|
||||
topoSetSource(mesh),
|
||||
p1_(dict.lookup("p1")),
|
||||
p2_(dict.lookup("p2")),
|
||||
point1_(dict.lookupBackwardsCompatible<point>({"point1", "p1"})),
|
||||
point2_(dict.lookupBackwardsCompatible<point>({"point2", "p2"})),
|
||||
outerRadius_(dict.lookup<scalar>("outerRadius")),
|
||||
innerRadius_(dict.lookup<scalar>("innerRadius"))
|
||||
{}
|
||||
@ -114,8 +114,8 @@ Foam::cylinderAnnulusToFace::cylinderAnnulusToFace
|
||||
)
|
||||
:
|
||||
topoSetSource(mesh),
|
||||
p1_(checkIs(is)),
|
||||
p2_(checkIs(is)),
|
||||
point1_(checkIs(is)),
|
||||
point2_(checkIs(is)),
|
||||
outerRadius_(readScalar(checkIs(is))),
|
||||
innerRadius_(readScalar(checkIs(is)))
|
||||
{}
|
||||
@ -138,19 +138,17 @@ void Foam::cylinderAnnulusToFace::applyToSet
|
||||
if ((action == topoSetSource::NEW) || (action == topoSetSource::ADD))
|
||||
{
|
||||
Info<< " Adding faces with centre within cylinder annulus,"
|
||||
<< " with p1 = "
|
||||
<< p1_ << ", p2 = " << p2_ << " and outer radius = " << outerRadius_
|
||||
<< " and inner radius = " << innerRadius_
|
||||
<< endl;
|
||||
<< " with point1 = "
|
||||
<< point1_ << ", point2 = " << point2_ << " and outer radius = "
|
||||
<< outerRadius_ << " and inner radius = " << innerRadius_ << endl;
|
||||
|
||||
combine(set, true);
|
||||
}
|
||||
else if (action == topoSetSource::DELETE)
|
||||
{
|
||||
Info<< " Removing faces with centre within cylinder, with p1 = "
|
||||
<< p1_ << ", p2 = " << p2_ << " and outer radius = " << outerRadius_
|
||||
<< " and inner radius " << innerRadius_
|
||||
<< endl;
|
||||
Info<< " Removing faces with centre within cylinder, with point1 = "
|
||||
<< point1_ << ", point2 = " << point2_ << " and outer radius = "
|
||||
<< outerRadius_ << " and inner radius " << innerRadius_ << endl;
|
||||
|
||||
combine(set, false);
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2017-2020 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2017-2021 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -58,10 +58,10 @@ class cylinderAnnulusToFace
|
||||
static addToUsageTable usage_;
|
||||
|
||||
//- First point on cylinder axis
|
||||
vector p1_;
|
||||
vector point1_;
|
||||
|
||||
//- Second point on cylinder axis
|
||||
vector p2_;
|
||||
vector point2_;
|
||||
|
||||
//- Outer Radius
|
||||
scalar outerRadius_;
|
||||
@ -87,8 +87,8 @@ public:
|
||||
cylinderAnnulusToFace
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const vector& p1,
|
||||
const vector& p2,
|
||||
const vector& point1,
|
||||
const vector& point2,
|
||||
const scalar outerRadius,
|
||||
const scalar innerRadius
|
||||
);
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2017-2019 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2017-2021 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -40,7 +40,8 @@ namespace Foam
|
||||
Foam::topoSetSource::addToUsageTable Foam::cylinderToFace::usage_
|
||||
(
|
||||
cylinderToFace::typeName,
|
||||
"\n Usage: cylinderToFace (p1X p1Y p1Z) (p2X p2Y p2Z) radius\n\n"
|
||||
"\n Usage: cylinderToFace (point1X point1Y point1Z)"
|
||||
" (point2X point2Y point2Z) radius\n\n"
|
||||
" Select all faces with face centre within bounding cylinder\n\n"
|
||||
);
|
||||
|
||||
@ -49,7 +50,7 @@ Foam::topoSetSource::addToUsageTable Foam::cylinderToFace::usage_
|
||||
|
||||
void Foam::cylinderToFace::combine(topoSet& set, const bool add) const
|
||||
{
|
||||
const vector axis = p2_ - p1_;
|
||||
const vector axis = point2_ - point1_;
|
||||
const scalar rad2 = sqr(radius_);
|
||||
const scalar magAxis2 = magSqr(axis);
|
||||
|
||||
@ -57,7 +58,7 @@ void Foam::cylinderToFace::combine(topoSet& set, const bool add) const
|
||||
|
||||
forAll(ctrs, facei)
|
||||
{
|
||||
vector d = ctrs[facei] - p1_;
|
||||
vector d = ctrs[facei] - point1_;
|
||||
scalar magD = d & axis;
|
||||
|
||||
if ((magD > 0) && (magD < magAxis2))
|
||||
@ -77,14 +78,14 @@ void Foam::cylinderToFace::combine(topoSet& set, const bool add) const
|
||||
Foam::cylinderToFace::cylinderToFace
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const vector& p1,
|
||||
const vector& p2,
|
||||
const vector& point1,
|
||||
const vector& point2,
|
||||
const scalar radius
|
||||
)
|
||||
:
|
||||
topoSetSource(mesh),
|
||||
p1_(p1),
|
||||
p2_(p2),
|
||||
point1_(point1),
|
||||
point2_(point2),
|
||||
radius_(radius)
|
||||
{}
|
||||
|
||||
@ -96,8 +97,8 @@ Foam::cylinderToFace::cylinderToFace
|
||||
)
|
||||
:
|
||||
topoSetSource(mesh),
|
||||
p1_(dict.lookup("p1")),
|
||||
p2_(dict.lookup("p2")),
|
||||
point1_(dict.lookupBackwardsCompatible<point>({"point1", "p1"})),
|
||||
point2_(dict.lookupBackwardsCompatible<point>({"point2", "p2"})),
|
||||
radius_(dict.lookup<scalar>("radius"))
|
||||
{}
|
||||
|
||||
@ -109,8 +110,8 @@ Foam::cylinderToFace::cylinderToFace
|
||||
)
|
||||
:
|
||||
topoSetSource(mesh),
|
||||
p1_(checkIs(is)),
|
||||
p2_(checkIs(is)),
|
||||
point1_(checkIs(is)),
|
||||
point2_(checkIs(is)),
|
||||
radius_(readScalar(checkIs(is)))
|
||||
{}
|
||||
|
||||
@ -131,15 +132,17 @@ void Foam::cylinderToFace::applyToSet
|
||||
{
|
||||
if ((action == topoSetSource::NEW) || (action == topoSetSource::ADD))
|
||||
{
|
||||
Info<< " Adding faces with centre within cylinder, with p1 = "
|
||||
<< p1_ << ", p2 = " << p2_ << " and radius = " << radius_ << endl;
|
||||
Info<< " Adding faces with centre within cylinder, with point1 = "
|
||||
<< point1_ << ", point2 = " << point2_ << " and radius = "
|
||||
<< radius_ << endl;
|
||||
|
||||
combine(set, true);
|
||||
}
|
||||
else if (action == topoSetSource::DELETE)
|
||||
{
|
||||
Info<< " Removing faces with centre within cylinder, with p1 = "
|
||||
<< p1_ << ", p2 = " << p2_ << " and radius = " << radius_ << endl;
|
||||
Info<< " Removing faces with centre within cylinder, with point1 = "
|
||||
<< point1_ << ", point2 = " << point2_ << " and radius = "
|
||||
<< radius_ << endl;
|
||||
|
||||
combine(set, false);
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2017-2020 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2017-2021 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -57,10 +57,10 @@ class cylinderToFace
|
||||
static addToUsageTable usage_;
|
||||
|
||||
//- First point on cylinder axis
|
||||
vector p1_;
|
||||
vector point1_;
|
||||
|
||||
//- Second point on cylinder axis
|
||||
vector p2_;
|
||||
vector point2_;
|
||||
|
||||
//- Radius
|
||||
scalar radius_;
|
||||
@ -83,8 +83,8 @@ public:
|
||||
cylinderToFace
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const vector& p1,
|
||||
const vector& p2,
|
||||
const vector& point1,
|
||||
const vector& point2,
|
||||
const scalar radius
|
||||
);
|
||||
|
||||
|
||||
@ -26,8 +26,8 @@ actions
|
||||
source cylinderToCell;
|
||||
sourceInfo
|
||||
{
|
||||
p1 (0 0 -100);
|
||||
p2 (0 0 100);
|
||||
point1 (0 0 -100);
|
||||
point2 (0 0 100);
|
||||
centre (0 0 0);
|
||||
radius $cylinderRadius;
|
||||
}
|
||||
|
||||
@ -14,288 +14,6 @@ FoamFile
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
// List of actions. Each action is a dictionary with e.g.
|
||||
// // name of set
|
||||
// name c0;
|
||||
//
|
||||
// // type: pointSet/faceSet/cellSet/faceZoneSet/cellZoneSet
|
||||
// type cellSet;
|
||||
//
|
||||
// // action to perform on set. Two types:
|
||||
// // - require no source : clear/invert
|
||||
// // - require source : new/add/delete/subset
|
||||
// action new;
|
||||
//
|
||||
// The source entry varies according to the type of set:
|
||||
//
|
||||
// cellSet
|
||||
// ~~~~~~~
|
||||
//
|
||||
// // Select by explicitly providing cell labels
|
||||
// source labelToCell;
|
||||
// {
|
||||
// value (12 13 56); // labels of cells
|
||||
// }
|
||||
//
|
||||
// // Copy elements from cellSet
|
||||
// source cellToCell;
|
||||
// {
|
||||
// set c1;
|
||||
// }
|
||||
//
|
||||
// // Cells in cell zone
|
||||
// source zoneToCell;
|
||||
// {
|
||||
// name ".*Zone"; // Name of cellZone, regular expressions allowed
|
||||
// }
|
||||
//
|
||||
// // Cells on master or slave side of faceZone
|
||||
// source faceZoneToCell;
|
||||
// {
|
||||
// name ".*Zone"; // Name of faceZone, regular expressions allowed
|
||||
// option master; // master/slave
|
||||
// }
|
||||
//
|
||||
// // Select based on faceSet
|
||||
// source faceToCell;
|
||||
// {
|
||||
// set f0; // Name of faceSet
|
||||
//
|
||||
// // option neighbour; // cell with neighbour in faceSet
|
||||
// // option owner; // ,, owner
|
||||
// option any; // cell with any face in faceSet
|
||||
// // option all; // cell with all faces in faceSet
|
||||
// }
|
||||
//
|
||||
// // Select based on pointSet
|
||||
// source pointToCell;
|
||||
// {
|
||||
// set p0;
|
||||
// option any; // cell with any point in pointSet
|
||||
// // option all; // cell with all points in pointSet
|
||||
// }
|
||||
//
|
||||
// // Select based on cellShape
|
||||
// source shapeToCell;
|
||||
// {
|
||||
// type hex; // hex/wedge/prism/pyr/tet/tetWedge/splitHex
|
||||
// }
|
||||
//
|
||||
// // Cells with cell centre within box
|
||||
// source boxToCell;
|
||||
// {
|
||||
// box (0 0 0) (1 1 1);
|
||||
// }
|
||||
//
|
||||
// // Cells with cell centre within box
|
||||
// // Is skewed, rotated box. Given as origin and three spanning vectors.
|
||||
// source rotatedBoxToCell;
|
||||
// {
|
||||
// origin (0.2 0.2 -10);
|
||||
// i (0.2 0.2 0);
|
||||
// j (-0.2 0.2 0);
|
||||
// k (10 10 10);
|
||||
// }
|
||||
//
|
||||
// // Cells with centre within cylinder
|
||||
// source cylinderToCell;
|
||||
// {
|
||||
// p1 (0.2 0.2 -10); // start point on cylinder axis
|
||||
// p2 (0.2 0.2 0); // end point on cylinder axis
|
||||
// radius 5.0;
|
||||
// }
|
||||
//
|
||||
// // Cells with centre within sphere
|
||||
// source sphereToCell;
|
||||
// {
|
||||
// centre (0.2 0.2 -10);
|
||||
// radius 5.0;
|
||||
// }
|
||||
//
|
||||
// // Cells with cellCentre nearest to coordinates
|
||||
// source nearestToCell;
|
||||
// {
|
||||
// points ((0 0 0) (1 1 1)(2 2 2));
|
||||
// }
|
||||
//
|
||||
// // Select based on surface
|
||||
// source surfaceToCell;
|
||||
// {
|
||||
// file "www.avl.com-geometry.stl";
|
||||
// outsidePoints ((-99 -99 -59)); // definition of outside
|
||||
// includeCut false; // cells cut by surface
|
||||
// includeInside false; // cells not on outside of surf
|
||||
// includeOutside false; // cells on outside of surf
|
||||
// nearDistance -1; // cells with centre near surf
|
||||
// // (set to -1 if not used)
|
||||
// curvature 0.9; // cells within nearDistance
|
||||
// // and near surf curvature
|
||||
// // (set to -100 if not used)
|
||||
// }
|
||||
//
|
||||
// // values of field within certain range
|
||||
// source fieldToCell;
|
||||
// {
|
||||
// field U; // Note: uses mag(U) since volVectorField
|
||||
// min 0.1;
|
||||
// max 0.5;
|
||||
// }
|
||||
//
|
||||
// // Mesh region (non-face connected part of (subset of)mesh)
|
||||
// source regionToCell;
|
||||
// {
|
||||
// set c0; // name of cellSet giving mesh subset
|
||||
// insidePoint (1 2 3); // point inside region to select
|
||||
// }
|
||||
//
|
||||
//
|
||||
//
|
||||
// faceSet
|
||||
// ~~~~~~~
|
||||
//
|
||||
// // Copy elements from faceSet
|
||||
// source faceToFace;
|
||||
// {
|
||||
// set f1;
|
||||
// }
|
||||
//
|
||||
// // Select based on cellSet
|
||||
// source cellToFace;
|
||||
// {
|
||||
// set c0;
|
||||
// option all; // All faces of cells
|
||||
// // option both; // Only faces whose owner&neighbour are in cellSet
|
||||
// }
|
||||
//
|
||||
// // Select based on pointSet
|
||||
// source pointToFace;
|
||||
// {
|
||||
// set p0;
|
||||
// option any; // Faces using any point in pointSet
|
||||
// // option all // Faces with all points in pointSet
|
||||
// }
|
||||
//
|
||||
// // Select by explicitly providing face labels
|
||||
// source labelToFace;
|
||||
// {
|
||||
// value (12 13 56); // labels of faces
|
||||
// }
|
||||
//
|
||||
// // All faces of patch
|
||||
// source patchToFace;
|
||||
// {
|
||||
// name ".*Wall"; // Name of patch, regular expressions allowed
|
||||
// }
|
||||
//
|
||||
// // All faces of faceZone
|
||||
// source zoneToFace;
|
||||
// {
|
||||
// name ".*Zone1"; // Name of faceZone, regular expressions allowed
|
||||
// }
|
||||
//
|
||||
// // Faces with face centre within box
|
||||
// source boxToFace;
|
||||
// {
|
||||
// box (0 0 0) (1 1 1);
|
||||
// }
|
||||
//
|
||||
// // Faces with normal to within certain angle aligned with vector.
|
||||
// source normalToFace;
|
||||
// {
|
||||
// normal (0 0 1); // Vector
|
||||
// cos 0.01; // Tolerance (max cos of angle)
|
||||
// }
|
||||
//
|
||||
//
|
||||
//
|
||||
// pointSet
|
||||
// ~~~~~~~
|
||||
//
|
||||
// // Copy elements from pointSet
|
||||
// source pointToPoint;
|
||||
// {
|
||||
// set p1;
|
||||
// }
|
||||
//
|
||||
// // Select based on cellSet
|
||||
// source cellToPoint;
|
||||
// {
|
||||
// set c0;
|
||||
// option all; // all points of cell
|
||||
// }
|
||||
//
|
||||
// // Select based on faceSet
|
||||
// source faceToPoint;
|
||||
// {
|
||||
// set f0; // name of faceSet
|
||||
// option all; // all points of face
|
||||
// }
|
||||
//
|
||||
// // Select by explicitly providing point labels
|
||||
// source labelToPoint;
|
||||
// {
|
||||
// value (12 13 56); // labels of points
|
||||
// }
|
||||
//
|
||||
// // All points in pointzone
|
||||
// source zoneToPoint;
|
||||
// {
|
||||
// name ".*Zone"; // name of pointZone, regular expressions allowed
|
||||
// }
|
||||
//
|
||||
// // Points nearest to coordinates
|
||||
// source nearestToPoint;
|
||||
// {
|
||||
// points ((0 0 0) (1 1 1));
|
||||
// }
|
||||
//
|
||||
// // Points with coordinate within box
|
||||
// source boxToPoint;
|
||||
// {
|
||||
// box (0 0 0) (1 1 1);
|
||||
// }
|
||||
//
|
||||
// // Select based on surface
|
||||
// source surfaceToPoint;
|
||||
// {
|
||||
// file "www.avl.com-geometry.stl";
|
||||
// nearDistance 0.1; // points near to surface
|
||||
// includeInside false; // points on inside of surface
|
||||
// // (requires closed surface with consistent
|
||||
// // normals)
|
||||
// includeOutside false; // ,, outside ,,
|
||||
// }
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
// cellZoneSet
|
||||
// ~~~~~~~~~~~
|
||||
// (mirrors operations on a cellSet into a cellZone)
|
||||
//
|
||||
// // Select based on cellSet
|
||||
// source setToCellZone;
|
||||
// {
|
||||
// set c0; // name of cellSet
|
||||
// }
|
||||
//
|
||||
//
|
||||
//
|
||||
// faceZoneSet
|
||||
// ~~~~~~~~~~~
|
||||
// // Select based on faceSet without orientation
|
||||
// source setToFaceZone;
|
||||
// {
|
||||
// set f0; // name of faceSet
|
||||
// }
|
||||
//
|
||||
// // Select based on faceSet, using cellSet to determine orientation
|
||||
// source setsToFaceZone;
|
||||
// {
|
||||
// faceSet f0; // name of faceSet
|
||||
// cellSet c0; // name of cellSet of slave side
|
||||
// }
|
||||
|
||||
actions
|
||||
(
|
||||
{
|
||||
|
||||
@ -23,8 +23,8 @@ actions
|
||||
source cylinderToCell;
|
||||
sourceInfo
|
||||
{
|
||||
p1 (0.435 0 0);
|
||||
p2 (0.44 0 0);
|
||||
point1 (0.435 0 0);
|
||||
point2 (0.44 0 0);
|
||||
radius 0.015875;
|
||||
}
|
||||
}
|
||||
|
||||
@ -23,8 +23,8 @@ actions
|
||||
source cylinderToCell;
|
||||
sourceInfo
|
||||
{
|
||||
p1 (0.435 0 0);
|
||||
p2 (0.44 0 0);
|
||||
point1 (0.435 0 0);
|
||||
point2 (0.44 0 0);
|
||||
radius 0.015875;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user