ENH: documentation and input simplification for surfaceFeatureExtract

This commit is contained in:
Mark Olesen
2017-06-01 15:46:42 +02:00
parent a335ba6b6b
commit b312f0ba40
8 changed files with 294 additions and 209 deletions

View File

@ -27,6 +27,7 @@ Class
Description
Run-time selectable surface feature extraction.
Selectable as "extractFromFile".
Mandatory dictionary entries: "featureEdgeFile".
Optional dictionary entries: "geometricTestOnly".
@ -60,17 +61,13 @@ class extractFromFile
public:
// Constructors
//- Construct from dictionary
extractFromFile(const dictionary& dict);
//- Construct from dictionary
extractFromFile(const dictionary& dict);
//- Destructor
virtual ~extractFromFile();
//- Extracted features from surface
//- Features loaded (extracted) from featureEdgeFile
virtual autoPtr<surfaceFeatures> features
(
const triSurface& surf

View File

@ -52,10 +52,10 @@ Foam::surfaceFeaturesExtraction::extractFromNone::extractFromNone
:
method()
{
const dictionary& coeffDict = dict.optionalSubDict("noneCoeffs");
// A "noneCoeffs" sub-dictionary doesn't make much sense.
coeffDict.readIfPresent("includedAngle", includedAngle_);
coeffDict.readIfPresent("geometricTestOnly", geometricTestOnly_);
dict.readIfPresent("includedAngle", includedAngle_);
dict.readIfPresent("geometricTestOnly", geometricTestOnly_);
}
@ -67,7 +67,6 @@ Foam::surfaceFeaturesExtraction::extractFromNone::~extractFromNone()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::autoPtr<Foam::surfaceFeatures>
Foam::surfaceFeaturesExtraction::extractFromNone::features
(

View File

@ -28,6 +28,7 @@ Description
Run-time selectable surface feature extraction - no extraction.
Primarily useful with self-intersection methods.
Selectable as "none".
Optional dictionary entries: "includedAngle", "geometricTestOnly".
SourceFiles
@ -58,16 +59,12 @@ class extractFromNone
public:
// Constructors
//- Construct from dictionary
extractFromNone(const dictionary& dict);
//- Construct from dictionary
extractFromNone(const dictionary& dict);
//- Destructor
virtual ~extractFromNone();
//- Extracted features from surface (no-op)
virtual autoPtr<surfaceFeatures> features
(

View File

@ -27,6 +27,8 @@ Class
Description
Run-time selectable surface feature extraction - extract from surface.
Selectable as "extractFromSurface".
Mandatory dictionary entries: "includedAngle".
Optional dictionary entries: "geometricTestOnly".
@ -57,23 +59,18 @@ class extractFromSurface
{
public:
// Constructors
//- Construct from dictionary
extractFromSurface(const dictionary& dict);
//- Construct from dictionary
extractFromSurface(const dictionary& dict);
//- Destructor
virtual ~extractFromSurface();
//- Extracted features from surface
//- Features extracted from surface
virtual autoPtr<surfaceFeatures> features
(
const triSurface& surf
) const override;
};

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2017 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2017 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -70,22 +70,20 @@ Foam::surfaceFeaturesExtraction::method::New
{
const word methodName = dict.lookup("extractionMethod");
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(methodName);
auto cstrIter = dictionaryConstructorTablePtr_->cfind(methodName);
if (!cstrIter.found())
{
FatalIOErrorInFunction
(
dict
) << "Unknown extractionMethod "
<< methodName << nl << nl
<< "Valid extraction methods: :" << nl
) << "Unknown extractionMethod " << methodName << nl << nl
<< "Valid extraction methods:" << nl
<< flatOutput(dictionaryConstructorTablePtr_->sortedToc())
<< exit(FatalIOError);
}
return autoPtr<method>(cstrIter()(dict));
return autoPtr<method>(cstrIter.object()(dict));
}

View File

@ -21,11 +21,17 @@ License
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Namespace
Foam::surfaceFeaturesExtraction
Description
Namespace for run-time selectable surface feature extraction methods.
Class
Foam::surfaceFeaturesExtraction::method
Description
Run-time selectable surface feature extraction methods.
Abstract base for run-time selectable surface feature extraction methods.
SourceFiles
surfaceFeaturesExtraction.C
@ -123,7 +129,6 @@ public:
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace surfaceFeaturesExtraction