mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: Added scale option to nastranSurfaceWriter
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -336,15 +336,17 @@ Foam::nastranSurfaceWriter::nastranSurfaceWriter()
|
||||
:
|
||||
surfaceWriter(),
|
||||
writeFormat_(wfShort),
|
||||
fieldMap_()
|
||||
fieldMap_(),
|
||||
scale_(1.0)
|
||||
{}
|
||||
|
||||
|
||||
Foam::nastranSurfaceWriter::nastranSurfaceWriter(const dictionary& options)
|
||||
:
|
||||
surfaceWriter(),
|
||||
writeFormat_(wfShort),
|
||||
fieldMap_()
|
||||
writeFormat_(wfLong),
|
||||
fieldMap_(),
|
||||
scale_(options.lookupOrDefault("scale", 1.0))
|
||||
{
|
||||
if (options.found("format"))
|
||||
{
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -75,6 +75,9 @@ private:
|
||||
//- Map of OpenFOAM field name vs nastran field name
|
||||
HashTable<word> fieldMap_;
|
||||
|
||||
//- Scale to apply to values (default = 1.0)
|
||||
scalar scale_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -46,6 +46,8 @@ void Foam::nastranSurfaceWriter::writeFaceValue
|
||||
|
||||
label SID = 1;
|
||||
|
||||
Type scaledValue = scale_*value;
|
||||
|
||||
switch (writeFormat_)
|
||||
{
|
||||
case wfShort:
|
||||
@ -59,7 +61,7 @@ void Foam::nastranSurfaceWriter::writeFaceValue
|
||||
|
||||
for (direction dirI = 0; dirI < pTraits<Type>::nComponents; dirI++)
|
||||
{
|
||||
os << setw(8) << component(value, dirI);
|
||||
os << setw(8) << component(scaledValue, dirI);
|
||||
}
|
||||
|
||||
os.unsetf(ios_base::right);
|
||||
@ -77,7 +79,7 @@ void Foam::nastranSurfaceWriter::writeFaceValue
|
||||
|
||||
for (direction dirI = 0; dirI < pTraits<Type>::nComponents; dirI++)
|
||||
{
|
||||
os << setw(16) << component(value, dirI);
|
||||
os << setw(16) << component(scaledValue, dirI);
|
||||
}
|
||||
|
||||
os.unsetf(ios_base::right);
|
||||
@ -98,7 +100,7 @@ void Foam::nastranSurfaceWriter::writeFaceValue
|
||||
|
||||
for (direction dirI = 0; dirI < pTraits<Type>::nComponents; dirI++)
|
||||
{
|
||||
os << ',' << component(value, dirI);
|
||||
os << ',' << component(scaledValue, dirI);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user