Commit 15c7d501 authored by mattijs's avatar mattijs
Browse files

ENH: surfaceInterpolateFields : enable writing

parent d730150e
......@@ -24,7 +24,6 @@ License
\*---------------------------------------------------------------------------*/
#include "surfaceInterpolateFields.H"
//#include "dictionary.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
......@@ -89,20 +88,21 @@ void Foam::surfaceInterpolateFields::read(const dictionary& dict)
void Foam::surfaceInterpolateFields::execute()
{
//Info<< type() << " " << name_ << ":" << nl;
// Clear out any previously loaded fields
ssf_.clear();
svf_.clear();
sSpheretf_.clear();
sSymmtf_.clear();
stf_.clear();
interpolateFields<scalar>(ssf_);
interpolateFields<vector>(svf_);
interpolateFields<sphericalTensor>(sSpheretf_);
interpolateFields<symmTensor>(sSymmtf_);
interpolateFields<tensor>(stf_);
if (active_)
{
// Clear out any previously loaded fields
ssf_.clear();
svf_.clear();
sSpheretf_.clear();
sSymmtf_.clear();
stf_.clear();
interpolateFields<scalar>(ssf_);
interpolateFields<vector>(svf_);
interpolateFields<sphericalTensor>(sSpheretf_);
interpolateFields<symmTensor>(sSymmtf_);
interpolateFields<tensor>(stf_);
}
}
......@@ -114,7 +114,32 @@ void Foam::surfaceInterpolateFields::end()
void Foam::surfaceInterpolateFields::write()
{
// Do nothing
if (active_)
{
Info<< "Writing interpolated surface fields to "
<< obr_.time().timeName() << endl;
forAll(ssf_, i)
{
ssf_[i].write();
}
forAll(svf_, i)
{
svf_[i].write();
}
forAll(sSpheretf_, i)
{
sSpheretf_[i].write();
}
forAll(sSymmtf_, i)
{
sSymmtf_[i].write();
}
forAll(stf_, i)
{
stf_[i].write();
}
}
}
......
......@@ -27,9 +27,24 @@ Class
Description
Linear interpolates volFields to surfaceFields
Note: gets executed every time step. Could move it to write() but then
you'd have problems if you have different write frequencies for different
function objects.
- at write it writes the fields
- it executes every time step
so it can either be used to calculate and write the interpolate or
(since the interpolates are registered) use some other functionObject
to work on them.
sampleSomeFields
{
type surfaceInterpolateFields;
..
enabled true;
outputControl outputTime;
..
// Name of volField and corresponding surfaceField
fields ((p pInterpolate)(U UInterpolate));
}
SourceFiles
surfaceInterpolateFields.C
......
Markdown is supported
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