Commit ba6ae13b authored by Andrew Heather's avatar Andrew Heather
Browse files

Merge branch 'develop' of develop.openfoam.com:Development/OpenFOAM-plus into develop

parents dd989a86 e619a82a
......@@ -15,8 +15,13 @@ if [ "$WM_LABEL_SIZE" = 64 ]
then
# The libccmio uses int32_t.
# The OpenFOAM adapter thus requires additional work for 64-bit labels.
echo "Skipping optional component libccm"
echo "Skipping optional 'libccm' adapter component"
echo " does not support 64-bit labels"
elif [ "$WM_PRECISION_OPTION" = SP ]
then
# The OpenFOAM adapter was originally only designed for 'double'
echo "Skipping optional 'libccm' adapter component"
echo " was not originally designed for 'single precision' values"
elif [ -e $CCMIO_ARCH_PATH/include/libccmio/ccmio.h \
-a -e $CCMIO_ARCH_PATH/lib/libccmio.a ]
then
......
......@@ -230,7 +230,7 @@ void Foam::fileFormats::STARCDCore::writePoints
(
Ostream& os,
const pointField& points,
const double scaleFactor
const scalar scaleFactor
)
{
writeHeader(os, HEADER_VRT);
......
......@@ -116,7 +116,7 @@ Foam::foamVtkFormatter::openTag(const word& tag)
Foam::foamVtkFormatter&
Foam::foamVtkFormatter::closeTag(bool isEmpty)
Foam::foamVtkFormatter::closeTag(const bool isEmpty)
{
if (!inTag_)
{
......@@ -207,20 +207,23 @@ Foam::foamVtkFormatter&
Foam::foamVtkFormatter::xmlAttr
(
const word& k,
const label v,
const int32_t v,
const char quote
)
{
if (!inTag_)
{
WarningInFunction
<< "xml attribute '" << k << "' but not within a tag!"
<< endl;
}
return xmlAttribute(k, v, quote);
}
os_ << ' ' << k << '=' << quote << v << quote;
return *this;
Foam::foamVtkFormatter&
Foam::foamVtkFormatter::xmlAttr
(
const word& k,
const int64_t v,
const char quote
)
{
return xmlAttribute(k, v, quote);
}
......@@ -232,16 +235,7 @@ Foam::foamVtkFormatter::xmlAttr
const char quote
)
{
if (!inTag_)
{
WarningInFunction
<< "xml attribute '" << k << "' but not within a tag!"
<< endl;
}
os_ << ' ' << k << '=' << quote << v << quote;
return *this;
return xmlAttribute(k, v, quote);
}
......@@ -253,16 +247,7 @@ Foam::foamVtkFormatter::xmlAttr
const char quote
)
{
if (!inTag_)
{
WarningInFunction
<< "xml attribute '" << k << "' but not within a tag!"
<< endl;
}
os_ << ' ' << k << '=' << quote << v << quote;
return *this;
return xmlAttribute(k, v, quote);
}
......@@ -283,7 +268,18 @@ Foam::foamVtkFormatter&
Foam::foamVtkFormatter::operator()
(
const word& k,
const label v
const int32_t v
)
{
return xmlAttr(k, v);
}
Foam::foamVtkFormatter&
Foam::foamVtkFormatter::operator()
(
const word& k,
const int64_t v
)
{
return xmlAttr(k, v);
......
......@@ -70,6 +70,16 @@ class foamVtkFormatter
mutable bool inTag_;
//- Write XML attribute
template<class Type>
foamVtkFormatter& xmlAttribute
(
const word&,
const Type&,
const char quote
);
protected:
// Protected Member Functions
......@@ -113,9 +123,9 @@ public:
virtual void writeSize(const uint64_t) = 0;
virtual void write(const uint8_t) = 0;
virtual void write(const label) = 0;
virtual void write(const float) = 0;
virtual void write(const double) = 0;
virtual void write(const label) = 0;
virtual void write(const float) = 0;
virtual void write(const double) = 0;
virtual void flush() = 0;
......@@ -136,7 +146,7 @@ public:
//- Close XML tag, optional as an empty container.
// Always adds a trailing newline.
foamVtkFormatter& closeTag(bool isEmpty = false);
foamVtkFormatter& closeTag(const bool isEmpty = false);
//- End XML tag, optional with sanity check
// Always adds a trailing newline.
......@@ -164,21 +174,28 @@ public:
}
//- Write XML attribute
foamVtkFormatter& xmlAttr
(
const word&,
const std::string&,
const char quote='\''
const char quote = '\''
);
//- Write XML attribute
foamVtkFormatter& xmlAttr
(
const word&,
const label,
const char quote='\''
const int32_t,
const char quote = '\''
);
//- Write XML attribute
foamVtkFormatter& xmlAttr
(
const word&,
const int64_t,
const char quote = '\''
);
//- Write XML attribute
......@@ -186,7 +203,7 @@ public:
(
const word&,
const uint64_t,
const char quote='\''
const char quote = '\''
);
//- Write XML attribute
......@@ -194,7 +211,7 @@ public:
(
const word&,
const scalar,
const char quote='\''
const char quote = '\''
);
......@@ -205,7 +222,10 @@ public:
foamVtkFormatter& operator()(const word&, const std::string&);
//- Write XML attribute
foamVtkFormatter& operator()(const word&, const label);
foamVtkFormatter& operator()(const word&, const int32_t);
//- Write XML attribute
foamVtkFormatter& operator()(const word&, const int64_t);
//- Write XML attribute
foamVtkFormatter& operator()(const word&, const uint64_t);
......
......@@ -26,6 +26,28 @@ License
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class Type>
Foam::foamVtkFormatter&
Foam::foamVtkFormatter::xmlAttribute
(
const word& k,
const Type& v,
const char quote
)
{
if (!inTag_)
{
WarningInFunction
<< "xml attribute '" << k << "' but not within a tag!"
<< endl;
}
os_ << ' ' << k << '=' << quote << v << quote;
return *this;
}
template<class Type, int nComp>
Foam::foamVtkFormatter& Foam::foamVtkFormatter::openDataArray
(
......
......@@ -77,8 +77,9 @@ void Foam::foamVtkLegacyFormatter::writeSize(const uint64_t)
void Foam::foamVtkLegacyFormatter::write(const uint8_t val)
{
// Can only handle integers
int copy(val);
// Legacy can only handle 32-bit integers.
// Nonetheless promote to 'label' (32 or 64 bit) and deal with it later
label copy(val);
write(copy);
}
......
......@@ -1104,9 +1104,9 @@ void Foam::turbulentDFSEMInletFvPatchVectorField::write(Ostream& os) const
fvPatchField<vector>::write(os);
writeEntry("value", os);
os.writeKeyword("delta") << delta_ << token::END_STATEMENT << nl;
writeEntryIfDifferent(os, "d", 1.0, d_);
writeEntryIfDifferent(os, "kappa", 0.41, kappa_);
writeEntryIfDifferent(os, "perturb", 1e-5, perturb_);
writeEntryIfDifferent<scalar>(os, "d", 1.0, d_);
writeEntryIfDifferent<scalar>(os, "kappa", 0.41, kappa_);
writeEntryIfDifferent<scalar>(os, "perturb", 1e-5, perturb_);
writeEntryIfDifferent<label>(os, "nCellPerEddy", 5, nCellPerEddy_);
writeEntryIfDifferent(os, "writeEddies", false, writeEddies_);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment