mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
BUG: incorrect symmTensor order for some ensight output (fixes #243)
- affects foamToEnsightParts, sampled surfaces - Use ensightPTraits mechanism throughout to avoid this issue
This commit is contained in:
@ -57,10 +57,10 @@ void Foam::writeCloudField
|
||||
val = Zero;
|
||||
}
|
||||
|
||||
for (direction i=0; i < pTraits<Type>::nComponents; ++i)
|
||||
for (direction d=0; d < pTraits<Type>::nComponents; ++d)
|
||||
{
|
||||
label cmpt = ensightPTraits<Type>::componentOrder[i];
|
||||
os.write( component(val, cmpt) );
|
||||
label cmpt = ensightPTraits<Type>::componentOrder[d];
|
||||
os.write(component(val, cmpt));
|
||||
|
||||
if (++count % 6 == 0)
|
||||
{
|
||||
@ -84,10 +84,10 @@ void Foam::writeCloudField
|
||||
val = Zero;
|
||||
}
|
||||
|
||||
for (direction i=0; i < pTraits<Type>::nComponents; ++i)
|
||||
for (direction d=0; d < pTraits<Type>::nComponents; ++d)
|
||||
{
|
||||
label cmpt = ensightPTraits<Type>::componentOrder[i];
|
||||
os.write( component(val, cmpt) );
|
||||
label cmpt = ensightPTraits<Type>::componentOrder[d];
|
||||
os.write(component(val, cmpt));
|
||||
|
||||
if (++count % 6 == 0)
|
||||
{
|
||||
@ -168,9 +168,9 @@ void Foam::ensightCloudField
|
||||
}
|
||||
|
||||
filePtr = new ensightFile(dataDir, postFileName, format);
|
||||
// description
|
||||
filePtr->write
|
||||
(
|
||||
// description
|
||||
string(postFileName + " <" + pTraits<Type>::typeName + ">")
|
||||
);
|
||||
filePtr->newline();
|
||||
|
||||
@ -24,6 +24,7 @@ License
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "ensightOutputFunctions.H"
|
||||
#include "ensightPTraits.H"
|
||||
|
||||
#include "passiveParticle.H"
|
||||
#include "IOField.H"
|
||||
@ -171,11 +172,8 @@ void Foam::ensightLagrangianField
|
||||
// when writing positions
|
||||
|
||||
ensightFile os(dataDir, postFileName, format);
|
||||
os.write
|
||||
(
|
||||
// description
|
||||
string(postFileName + " with " + pTraits<Type>::typeName + " values")
|
||||
);
|
||||
// description
|
||||
os.write(string(postFileName + " <" + pTraits<Type>::typeName + ">"));
|
||||
os.newline();
|
||||
|
||||
IOField<Type> field(fieldObject);
|
||||
@ -187,21 +185,20 @@ void Foam::ensightLagrangianField
|
||||
{
|
||||
Type val = field[i];
|
||||
|
||||
if (mag(val) < 1.0e-90)
|
||||
if (mag(val) < 1e-90)
|
||||
{
|
||||
val = Zero;
|
||||
}
|
||||
|
||||
for (direction cmpt=0; cmpt < pTraits<Type>::nComponents; cmpt++)
|
||||
for (direction d=0; d < pTraits<Type>::nComponents; ++d)
|
||||
{
|
||||
os.write( component(val, cmpt) );
|
||||
}
|
||||
label cmpt = ensightPTraits<Type>::componentOrder[d];
|
||||
os.write(component(val, cmpt));
|
||||
|
||||
count += pTraits<Type>::nComponents;
|
||||
|
||||
if (count % 6 == 0)
|
||||
{
|
||||
os.newline();
|
||||
if (++count % 6 == 0)
|
||||
{
|
||||
os.newline();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user