mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
STYLE: enumerate Nastran PLOADs in NASCore
This commit is contained in:
@ -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-2019 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -42,6 +42,17 @@ Foam::fileFormats::NASCore::fieldFormatNames
|
||||
});
|
||||
|
||||
|
||||
const Foam::Enum
|
||||
<
|
||||
Foam::fileFormats::NASCore::loadFormat
|
||||
>
|
||||
Foam::fileFormats::NASCore::loadFormatNames
|
||||
({
|
||||
{ loadFormat::PLOAD2, "PLOAD2" },
|
||||
{ loadFormat::PLOAD4, "PLOAD4" },
|
||||
});
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
|
||||
|
||||
Foam::scalar Foam::fileFormats::NASCore::readNasScalar(const std::string& str)
|
||||
|
||||
@ -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-2019 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -69,6 +69,16 @@ public:
|
||||
//- Selection names for the NASTRAN file field formats
|
||||
static const Enum<fieldFormat> fieldFormatNames;
|
||||
|
||||
//- Output load format
|
||||
enum loadFormat
|
||||
{
|
||||
PLOAD2,
|
||||
PLOAD4
|
||||
};
|
||||
|
||||
//- Selection names for the NASTRAN file field formats
|
||||
static const Enum<loadFormat> loadFormatNames;
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
|
||||
@ -37,17 +37,6 @@ namespace Foam
|
||||
addToRunTimeSelectionTable(surfaceWriter, nastranSurfaceWriter, wordDict);
|
||||
}
|
||||
|
||||
const Foam::Enum
|
||||
<
|
||||
Foam::nastranSurfaceWriter::loadFormat
|
||||
>
|
||||
Foam::nastranSurfaceWriter::loadFormatNames_
|
||||
({
|
||||
{ loadFormat::PLOAD2, "PLOAD2" },
|
||||
{ loadFormat::PLOAD4, "PLOAD4" },
|
||||
});
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
// Field writing implementation
|
||||
@ -356,7 +345,7 @@ Foam::nastranSurfaceWriter::nastranSurfaceWriter(const dictionary& options)
|
||||
fieldMap_.insert
|
||||
(
|
||||
item.first(),
|
||||
loadFormatNames_[item.second()]
|
||||
fileFormats::NASCore::loadFormatNames[item.second()]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -110,19 +110,13 @@ public:
|
||||
using fieldFormat = Foam::fileFormats::NASCore::fieldFormat;
|
||||
|
||||
//- Output load format
|
||||
enum loadFormat
|
||||
{
|
||||
PLOAD2,
|
||||
PLOAD4
|
||||
};
|
||||
using loadFormat = Foam::fileFormats::NASCore::loadFormat;
|
||||
|
||||
|
||||
private:
|
||||
|
||||
// Private data
|
||||
|
||||
static const Enum<loadFormat> loadFormatNames_;
|
||||
|
||||
//- Field format (width and separator)
|
||||
fieldFormat writeFormat_;
|
||||
|
||||
|
||||
@ -89,7 +89,8 @@ Foam::Ostream& Foam::nastranSurfaceWriter::writeFaceValue
|
||||
Type scaledValue = scale_*value;
|
||||
|
||||
// Write keyword
|
||||
writeKeyword(os, loadFormatNames_[format]) << separator_;
|
||||
writeKeyword(os, fileFormats::NASCore::loadFormatNames[format])
|
||||
<< separator_;
|
||||
|
||||
// Write load set ID
|
||||
os.setf(std::ios_base::right);
|
||||
@ -107,8 +108,9 @@ Foam::Ostream& Foam::nastranSurfaceWriter::writeFaceValue
|
||||
else
|
||||
{
|
||||
WarningInFunction
|
||||
<< loadFormatNames_[format] << " requires scalar values "
|
||||
<< "and cannot be used for higher rank values"
|
||||
<< fileFormats::NASCore::loadFormatNames[format]
|
||||
<< " requires scalar values"
|
||||
<< " - it cannot be used for higher rank values"
|
||||
<< endl;
|
||||
|
||||
writeValue(os, scalar(0)) << separator_;
|
||||
|
||||
Reference in New Issue
Block a user