Added support for sphericalTensor and symmTensor.
This commit is contained in:
parent
700ba91ec7
commit
436b8f075d
@ -13,10 +13,10 @@ sampledSet/sampledSets/sampledSets.C
|
|||||||
sampledSet/sampledSetsFunctionObject/sampledSetsFunctionObject.C
|
sampledSet/sampledSetsFunctionObject/sampledSetsFunctionObject.C
|
||||||
|
|
||||||
sampledSet/writers/writer/writers.C
|
sampledSet/writers/writer/writers.C
|
||||||
|
sampledSet/writers/raw/rawWriters.C
|
||||||
sampledSet/writers/xmgr/xmgrWriters.C
|
sampledSet/writers/xmgr/xmgrWriters.C
|
||||||
sampledSet/writers/gnuplot/gnuplotWriters.C
|
sampledSet/writers/gnuplot/gnuplotWriters.C
|
||||||
sampledSet/writers/jplot/jplotWriters.C
|
sampledSet/writers/jplot/jplotWriters.C
|
||||||
sampledSet/writers/raw/rawWriters.C
|
|
||||||
|
|
||||||
cuttingPlane/cuttingPlane.C
|
cuttingPlane/cuttingPlane.C
|
||||||
|
|
||||||
|
@ -63,28 +63,26 @@ public:
|
|||||||
//- Construct null
|
//- Construct null
|
||||||
gnuplot();
|
gnuplot();
|
||||||
|
|
||||||
// Destructor
|
|
||||||
|
|
||||||
virtual ~gnuplot();
|
//- Destructor
|
||||||
|
virtual ~gnuplot();
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
// Write
|
virtual fileName getFileName
|
||||||
|
(
|
||||||
|
const coordSet&,
|
||||||
|
const wordList&
|
||||||
|
) const;
|
||||||
|
|
||||||
virtual fileName getFileName
|
void write
|
||||||
(
|
(
|
||||||
const coordSet&,
|
const coordSet&,
|
||||||
const wordList&
|
const wordList&,
|
||||||
) const;
|
const List<const Field<Type>*>&,
|
||||||
|
Ostream& os
|
||||||
void write
|
) const;
|
||||||
(
|
|
||||||
const coordSet&,
|
|
||||||
const wordList&,
|
|
||||||
const List<const Field<Type>*>&,
|
|
||||||
Ostream& os
|
|
||||||
) const;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -22,8 +22,6 @@ License
|
|||||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
Description
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "gnuplotWriters.H"
|
#include "gnuplotWriters.H"
|
||||||
@ -33,13 +31,7 @@ Description
|
|||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
makeWriters(gnuplot)
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
}
|
||||||
|
|
||||||
makeWriters(gnuplot);
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
@ -25,12 +25,9 @@ License
|
|||||||
InClass
|
InClass
|
||||||
Foam::gnuplotWriters
|
Foam::gnuplotWriters
|
||||||
|
|
||||||
Description
|
|
||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
gnuplotWriters.C
|
gnuplotWriters.C
|
||||||
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef gnuplotWriters_H
|
#ifndef gnuplotWriters_H
|
||||||
@ -44,16 +41,8 @@ SourceFiles
|
|||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
makeWritersTypedefs(gnuplot)
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
}
|
||||||
|
|
||||||
typedef gnuplot<scalar> gnuplotScalarWriter;
|
|
||||||
typedef gnuplot<vector> gnuplotVectorWriter;
|
|
||||||
typedef gnuplot<tensor> gnuplotTensorWriter;
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
@ -25,8 +25,6 @@ License
|
|||||||
Class
|
Class
|
||||||
Foam::jplot
|
Foam::jplot
|
||||||
|
|
||||||
Description
|
|
||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
jplot.C
|
jplot.C
|
||||||
|
|
||||||
@ -43,8 +41,6 @@ SourceFiles
|
|||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
|
||||||
// Forward declaration of classes
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class jplot Declaration
|
Class jplot Declaration
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
@ -71,30 +67,26 @@ public:
|
|||||||
//- Construct null
|
//- Construct null
|
||||||
jplot();
|
jplot();
|
||||||
|
|
||||||
// Destructor
|
|
||||||
|
|
||||||
virtual ~jplot();
|
//- Destructor
|
||||||
|
virtual ~jplot();
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
// Access
|
virtual fileName getFileName
|
||||||
|
(
|
||||||
|
const coordSet&,
|
||||||
|
const wordList&
|
||||||
|
) const;
|
||||||
|
|
||||||
// Write
|
void write
|
||||||
|
(
|
||||||
virtual fileName getFileName
|
const coordSet&,
|
||||||
(
|
const wordList&,
|
||||||
const coordSet&,
|
const List<const Field<Type>*>&,
|
||||||
const wordList&
|
Ostream& os
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
void write
|
|
||||||
(
|
|
||||||
const coordSet&,
|
|
||||||
const wordList&,
|
|
||||||
const List<const Field<Type>*>&,
|
|
||||||
Ostream& os
|
|
||||||
) const;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -22,8 +22,6 @@ License
|
|||||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
Description
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "jplotWriters.H"
|
#include "jplotWriters.H"
|
||||||
@ -33,13 +31,7 @@ Description
|
|||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
makeWriters(jplot)
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
}
|
||||||
|
|
||||||
makeWriters(jplot);
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
@ -25,12 +25,9 @@ License
|
|||||||
InClass
|
InClass
|
||||||
Foam::jplotWriters
|
Foam::jplotWriters
|
||||||
|
|
||||||
Description
|
|
||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
jplotWriters.C
|
jplotWriters.C
|
||||||
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef jplotWriters_H
|
#ifndef jplotWriters_H
|
||||||
@ -44,16 +41,8 @@ SourceFiles
|
|||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
makeWritersTypedefs(jplot)
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
}
|
||||||
|
|
||||||
typedef jplot<scalar> jplotScalarWriter;
|
|
||||||
typedef jplot<vector> jplotVectorWriter;
|
|
||||||
typedef jplot<tensor> jplotTensorWriter;
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
@ -64,28 +64,25 @@ public:
|
|||||||
raw();
|
raw();
|
||||||
|
|
||||||
|
|
||||||
// Destructor
|
//- Destructor
|
||||||
|
virtual ~raw();
|
||||||
virtual ~raw();
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
// Write
|
virtual fileName getFileName
|
||||||
|
(
|
||||||
|
const coordSet&,
|
||||||
|
const wordList&
|
||||||
|
) const;
|
||||||
|
|
||||||
virtual fileName getFileName
|
virtual void write
|
||||||
(
|
(
|
||||||
const coordSet&,
|
const coordSet&,
|
||||||
const wordList&
|
const wordList&,
|
||||||
) const;
|
const List<const Field<Type>*>&,
|
||||||
|
Ostream& os
|
||||||
virtual void write
|
) const;
|
||||||
(
|
|
||||||
const coordSet&,
|
|
||||||
const wordList&,
|
|
||||||
const List<const Field<Type>*>&,
|
|
||||||
Ostream& os
|
|
||||||
) const;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -22,8 +22,6 @@ License
|
|||||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
Description
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "rawWriters.H"
|
#include "rawWriters.H"
|
||||||
@ -33,13 +31,7 @@ Description
|
|||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
makeWriters(raw)
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
}
|
||||||
|
|
||||||
makeWriters(raw);
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
@ -25,12 +25,9 @@ License
|
|||||||
InClass
|
InClass
|
||||||
Foam::rawWriters
|
Foam::rawWriters
|
||||||
|
|
||||||
Description
|
|
||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
rawWriters.C
|
rawWriters.C
|
||||||
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef rawWriters_H
|
#ifndef rawWriters_H
|
||||||
@ -44,16 +41,8 @@ SourceFiles
|
|||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
makeWritersTypedefs(raw)
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
}
|
||||||
|
|
||||||
typedef raw<scalar> rawScalarWriter;
|
|
||||||
typedef raw<vector> rawVectorWriter;
|
|
||||||
typedef raw<tensor> rawTensorWriter;
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
@ -31,11 +31,11 @@ License
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
autoPtr<writer<Type> > writer<Type>::New(const word& writeType)
|
Foam::autoPtr<Foam::writer<Type> > Foam::writer<Type>::New
|
||||||
|
(
|
||||||
|
const word& writeType
|
||||||
|
)
|
||||||
{
|
{
|
||||||
typename wordConstructorTable::iterator cstrIter =
|
typename wordConstructorTable::iterator cstrIter =
|
||||||
wordConstructorTablePtr_
|
wordConstructorTablePtr_
|
||||||
@ -60,7 +60,7 @@ autoPtr<writer<Type> > writer<Type>::New(const word& writeType)
|
|||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
fileName writer<Type>::getBaseName
|
Foam::fileName Foam::writer<Type>::getBaseName
|
||||||
(
|
(
|
||||||
const coordSet& points,
|
const coordSet& points,
|
||||||
const wordList& valueSets
|
const wordList& valueSets
|
||||||
@ -78,7 +78,7 @@ fileName writer<Type>::getBaseName
|
|||||||
|
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
void writer<Type>::writeCoord
|
void Foam::writer<Type>::writeCoord
|
||||||
(
|
(
|
||||||
const coordSet& points,
|
const coordSet& points,
|
||||||
const label pointI,
|
const label pointI,
|
||||||
@ -97,7 +97,7 @@ void writer<Type>::writeCoord
|
|||||||
|
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
void writer<Type>::writeTable
|
void Foam::writer<Type>::writeTable
|
||||||
(
|
(
|
||||||
const coordSet& points,
|
const coordSet& points,
|
||||||
const List<Type>& values,
|
const List<Type>& values,
|
||||||
@ -109,16 +109,14 @@ void writer<Type>::writeTable
|
|||||||
writeCoord(points, pointI, os);
|
writeCoord(points, pointI, os);
|
||||||
|
|
||||||
os << token::SPACE;
|
os << token::SPACE;
|
||||||
|
|
||||||
write(values[pointI], os);
|
write(values[pointI], os);
|
||||||
|
|
||||||
os << endl;
|
os << endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
void writer<Type>::writeTable
|
void Foam::writer<Type>::writeTable
|
||||||
(
|
(
|
||||||
const coordSet& points,
|
const coordSet& points,
|
||||||
const List<const List<Type>*>& valuesPtrList,
|
const List<const List<Type>*>& valuesPtrList,
|
||||||
@ -132,9 +130,7 @@ void writer<Type>::writeTable
|
|||||||
forAll(valuesPtrList, i)
|
forAll(valuesPtrList, i)
|
||||||
{
|
{
|
||||||
os << token::SPACE;
|
os << token::SPACE;
|
||||||
|
|
||||||
const List<Type>& values = *valuesPtrList[i];
|
const List<Type>& values = *valuesPtrList[i];
|
||||||
|
|
||||||
write(values[pointI], os);
|
write(values[pointI], os);
|
||||||
}
|
}
|
||||||
os << endl;
|
os << endl;
|
||||||
@ -144,36 +140,44 @@ void writer<Type>::writeTable
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
// Construct null
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
writer<Type>::writer()
|
Foam::writer<Type>::writer()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
writer<Type>::~writer()
|
Foam::writer<Type>::~writer()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
Foam::Ostream& Foam::writer<Type>::write(const scalar value, Ostream& os) const
|
Foam::Ostream& Foam::writer<Type>::write
|
||||||
|
(
|
||||||
|
const scalar value,
|
||||||
|
Ostream& os
|
||||||
|
) const
|
||||||
{
|
{
|
||||||
return os << value;
|
return os << value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
Foam::Ostream& Foam::writer<Type>::write(const vector& value, Ostream& os) const
|
template<class VSType>
|
||||||
|
Foam::Ostream& Foam::writer<Type>::writeVS
|
||||||
|
(
|
||||||
|
const VSType& value,
|
||||||
|
Ostream& os
|
||||||
|
) const
|
||||||
{
|
{
|
||||||
for (direction d=0; d<vector::nComponents; d++)
|
for (direction d=0; d<VSType::nComponents; d++)
|
||||||
{
|
{
|
||||||
os << value.component(d);
|
os << value.component(d);
|
||||||
|
|
||||||
if (d <= vector::nComponents-1)
|
if (d <= VSType::nComponents-1)
|
||||||
{
|
{
|
||||||
os << token::TAB;
|
os << token::TAB;
|
||||||
}
|
}
|
||||||
@ -183,23 +187,47 @@ Foam::Ostream& Foam::writer<Type>::write(const vector& value, Ostream& os) const
|
|||||||
|
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
Foam::Ostream& Foam::writer<Type>::write(const tensor& value, Ostream& os) const
|
Foam::Ostream& Foam::writer<Type>::write
|
||||||
|
(
|
||||||
|
const vector& value,
|
||||||
|
Ostream& os
|
||||||
|
) const
|
||||||
{
|
{
|
||||||
for (direction d=0; d<tensor::nComponents; d++)
|
return writeVS(value, os);
|
||||||
{
|
|
||||||
os << value.component(d);
|
|
||||||
|
|
||||||
if (d <= tensor::nComponents-1)
|
|
||||||
{
|
|
||||||
os << token::TAB;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return os;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
template<class Type>
|
||||||
|
Foam::Ostream& Foam::writer<Type>::write
|
||||||
|
(
|
||||||
|
const sphericalTensor& value,
|
||||||
|
Ostream& os
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
return writeVS(value, os);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
Foam::Ostream& Foam::writer<Type>::write
|
||||||
|
(
|
||||||
|
const symmTensor& value,
|
||||||
|
Ostream& os
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
return writeVS(value, os);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
Foam::Ostream& Foam::writer<Type>::write
|
||||||
|
(
|
||||||
|
const tensor& value,
|
||||||
|
Ostream& os
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
return writeVS(value, os);
|
||||||
|
}
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
@ -29,8 +29,8 @@ Description
|
|||||||
Base class for graphics format writing. Entry points are
|
Base class for graphics format writing. Entry points are
|
||||||
- write(..). \n
|
- write(..). \n
|
||||||
Write to an Ostream a table of points with corresponding values.
|
Write to an Ostream a table of points with corresponding values.
|
||||||
- write(scalar/vector/tensor). \n
|
- write(scalar/vector/sphericalTensor/symmTensor/tensor). \n
|
||||||
Write single scalar/vector/tensor.
|
Write single scalar/vector/sphericalTensor/symmTensor/tensor.
|
||||||
Default is to write space separated components.
|
Default is to write space separated components.
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
@ -151,43 +151,47 @@ public:
|
|||||||
writer();
|
writer();
|
||||||
|
|
||||||
|
|
||||||
// Destructor
|
//- Destructor
|
||||||
|
virtual ~writer() = 0;
|
||||||
virtual ~writer() = 0;
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
// Access
|
//- Generate file name with correct extension
|
||||||
|
virtual fileName getFileName
|
||||||
|
(
|
||||||
|
const coordSet&,
|
||||||
|
const wordList&
|
||||||
|
) const = 0;
|
||||||
|
|
||||||
// Write
|
//- General entry point for writing.
|
||||||
|
// The data is organized in a set of point with one or
|
||||||
|
// more values per point
|
||||||
|
virtual void write
|
||||||
|
(
|
||||||
|
const coordSet&,
|
||||||
|
const wordList&,
|
||||||
|
const List<const Field<Type>*>&,
|
||||||
|
Ostream&
|
||||||
|
) const = 0;
|
||||||
|
|
||||||
//- Generate file name with correct extension
|
//- Write scalar as ascii
|
||||||
virtual fileName getFileName
|
virtual Ostream& write(const scalar, Ostream&) const;
|
||||||
(
|
|
||||||
const coordSet&,
|
|
||||||
const wordList&
|
|
||||||
) const = 0;
|
|
||||||
|
|
||||||
//- General entry point for writing.
|
template<class VSType>
|
||||||
// The data is organized in a set of point with one or
|
Ostream& writeVS(const VSType& value, Ostream& os) const;
|
||||||
// more values per point
|
|
||||||
virtual void write
|
|
||||||
(
|
|
||||||
const coordSet&,
|
|
||||||
const wordList&,
|
|
||||||
const List<const Field<Type>*>&,
|
|
||||||
Ostream&
|
|
||||||
) const = 0;
|
|
||||||
|
|
||||||
//- Write scalar as ascii
|
//- Write vector. Tab separated ascii
|
||||||
virtual Ostream& write(const scalar, Ostream&) const;
|
virtual Ostream& write(const vector&, Ostream&) const;
|
||||||
|
|
||||||
//- Write vector. Tab separated ascii
|
//- Write sphericalTensor. Tab separated ascii
|
||||||
virtual Ostream& write(const vector&, Ostream&) const;
|
virtual Ostream& write(const sphericalTensor&, Ostream&) const;
|
||||||
|
|
||||||
//- Write tensor. Tab separated ascii
|
//- Write symmTensor. Tab separated ascii
|
||||||
virtual Ostream& write(const tensor&, Ostream&) const;
|
virtual Ostream& write(const symmTensor&, Ostream&) const;
|
||||||
|
|
||||||
|
//- Write tensor. Tab separated ascii
|
||||||
|
virtual Ostream& write(const tensor&, Ostream&) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -202,34 +206,47 @@ public:
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Only used internally
|
// Only used internally
|
||||||
#define makeTypeWritersTypeName(type) \
|
#define makeTypeWritersTypeName(type) \
|
||||||
\
|
\
|
||||||
defineNamedTemplateTypeNameAndDebug(type, 0);
|
defineNamedTemplateTypeNameAndDebug(type, 0);
|
||||||
|
|
||||||
// Used externally sometimes
|
// Used externally sometimes
|
||||||
#define makeWritersTypeName(typeWriter) \
|
#define makeWritersTypeName(typeWriter) \
|
||||||
\
|
\
|
||||||
makeTypeWritersTypeName(typeWriter##ScalarWriter); \
|
makeTypeWritersTypeName(typeWriter##ScalarWriter); \
|
||||||
makeTypeWritersTypeName(typeWriter##VectorWriter); \
|
makeTypeWritersTypeName(typeWriter##VectorWriter); \
|
||||||
|
makeTypeWritersTypeName(typeWriter##SphericalTensorWriter); \
|
||||||
|
makeTypeWritersTypeName(typeWriter##SymmTensorWriter); \
|
||||||
makeTypeWritersTypeName(typeWriter##TensorWriter);
|
makeTypeWritersTypeName(typeWriter##TensorWriter);
|
||||||
|
|
||||||
// Define type info for single template instantiation (e.g. vector)
|
// Define type info for single template instantiation (e.g. vector)
|
||||||
#define makeWriterTypes(WriterType, type) \
|
#define makeWriterTypes(WriterType, type) \
|
||||||
\
|
\
|
||||||
defineNamedTemplateTypeNameAndDebug(type, 0); \
|
defineNamedTemplateTypeNameAndDebug(type, 0); \
|
||||||
\
|
\
|
||||||
addToRunTimeSelectionTable \
|
addToRunTimeSelectionTable \
|
||||||
( \
|
( \
|
||||||
WriterType, type, word \
|
WriterType, type, word \
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
// Define type info info for scalar, vector etc. instantiations
|
// Define type info info for scalar, vector etc. instantiations
|
||||||
#define makeWriters(typeWriter) \
|
#define makeWriters(typeWriter) \
|
||||||
\
|
\
|
||||||
makeWriterTypes(scalarWriter, typeWriter##ScalarWriter); \
|
makeWriterTypes(writerScalarWriter, typeWriter##ScalarWriter); \
|
||||||
makeWriterTypes(vectorWriter, typeWriter##VectorWriter); \
|
makeWriterTypes(writerVectorWriter, typeWriter##VectorWriter); \
|
||||||
makeWriterTypes(tensorWriter, typeWriter##TensorWriter);
|
makeWriterTypes(writerSphericalTensorWriter, typeWriter##SphericalTensorWriter);\
|
||||||
|
makeWriterTypes(writerSymmTensorWriter, typeWriter##SymmTensorWriter); \
|
||||||
|
makeWriterTypes(writerTensorWriter, typeWriter##TensorWriter);
|
||||||
|
|
||||||
|
|
||||||
|
#define makeWritersTypedefs(typeWriter) \
|
||||||
|
\
|
||||||
|
typedef typeWriter<scalar> typeWriter##ScalarWriter; \
|
||||||
|
typedef typeWriter<vector> typeWriter##VectorWriter; \
|
||||||
|
typedef typeWriter<sphericalTensor> typeWriter##SphericalTensorWriter; \
|
||||||
|
typedef typeWriter<symmTensor> typeWriter##SymmTensorWriter; \
|
||||||
|
typedef typeWriter<tensor> typeWriter##TensorWriter;
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
@ -22,8 +22,6 @@ License
|
|||||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
Description
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "writers.H"
|
#include "writers.H"
|
||||||
@ -35,20 +33,20 @@ namespace Foam
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
defineNamedTemplateTypeNameAndDebug(scalarWriter, 0);
|
defineNamedTemplateTypeNameAndDebug(writerScalarWriter, 0);
|
||||||
defineTemplateRunTimeSelectionTable(scalarWriter, word);
|
defineTemplateRunTimeSelectionTable(writerScalarWriter, word);
|
||||||
|
|
||||||
defineNamedTemplateTypeNameAndDebug(vectorWriter, 0);
|
defineNamedTemplateTypeNameAndDebug(writerVectorWriter, 0);
|
||||||
defineTemplateRunTimeSelectionTable(vectorWriter, word);
|
defineTemplateRunTimeSelectionTable(writerVectorWriter, word);
|
||||||
|
|
||||||
defineNamedTemplateTypeNameAndDebug(sphericalTensorWriter, 0);
|
defineNamedTemplateTypeNameAndDebug(writerSphericalTensorWriter, 0);
|
||||||
defineTemplateRunTimeSelectionTable(sphericalTensorWriter, word);
|
defineTemplateRunTimeSelectionTable(writerSphericalTensorWriter, word);
|
||||||
|
|
||||||
defineNamedTemplateTypeNameAndDebug(symmTensorWriter, 0);
|
defineNamedTemplateTypeNameAndDebug(writerSymmTensorWriter, 0);
|
||||||
defineTemplateRunTimeSelectionTable(symmTensorWriter, word);
|
defineTemplateRunTimeSelectionTable(writerSymmTensorWriter, word);
|
||||||
|
|
||||||
defineNamedTemplateTypeNameAndDebug(tensorWriter, 0);
|
defineNamedTemplateTypeNameAndDebug(writerTensorWriter, 0);
|
||||||
defineTemplateRunTimeSelectionTable(tensorWriter, word);
|
defineTemplateRunTimeSelectionTable(writerTensorWriter, word);
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
@ -23,9 +23,10 @@ License
|
|||||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
InClass
|
InClass
|
||||||
Foam::writer
|
Foam::rawWriters
|
||||||
|
|
||||||
Description
|
SourceFiles
|
||||||
|
writers.C
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
@ -39,18 +40,8 @@ Description
|
|||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
makeWritersTypedefs(writer)
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
}
|
||||||
|
|
||||||
typedef writer<scalar> scalarWriter;
|
|
||||||
typedef writer<vector> vectorWriter;
|
|
||||||
typedef writer<sphericalTensor> sphericalTensorWriter;
|
|
||||||
typedef writer<symmTensor> symmTensorWriter;
|
|
||||||
typedef writer<tensor> tensorWriter;
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
@ -63,28 +63,26 @@ public:
|
|||||||
//- Construct null
|
//- Construct null
|
||||||
xmgr();
|
xmgr();
|
||||||
|
|
||||||
// Destructor
|
|
||||||
|
|
||||||
virtual ~xmgr();
|
//- Destructor
|
||||||
|
virtual ~xmgr();
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
// Write
|
virtual fileName getFileName
|
||||||
|
(
|
||||||
|
const coordSet&,
|
||||||
|
const wordList&
|
||||||
|
) const;
|
||||||
|
|
||||||
virtual fileName getFileName
|
void write
|
||||||
(
|
(
|
||||||
const coordSet&,
|
const coordSet&,
|
||||||
const wordList&
|
const wordList&,
|
||||||
) const;
|
const List<const Field<Type>*>&,
|
||||||
|
Ostream& os
|
||||||
void write
|
) const;
|
||||||
(
|
|
||||||
const coordSet&,
|
|
||||||
const wordList&,
|
|
||||||
const List<const Field<Type>*>&,
|
|
||||||
Ostream& os
|
|
||||||
) const;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -22,8 +22,6 @@ License
|
|||||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
Description
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "xmgrWriters.H"
|
#include "xmgrWriters.H"
|
||||||
@ -33,13 +31,7 @@ Description
|
|||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
makeWriters(xmgr)
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
}
|
||||||
|
|
||||||
makeWriters(xmgr);
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
@ -44,16 +44,8 @@ SourceFiles
|
|||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
makeWritersTypedefs(xmgr)
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
}
|
||||||
|
|
||||||
typedef xmgr<scalar> xmgrScalarWriter;
|
|
||||||
typedef xmgr<vector> xmgrVectorWriter;
|
|
||||||
typedef xmgr<tensor> xmgrTensorWriter;
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user