Commit 586222c5 authored by mark's avatar mark

DEFEATURE: remove 'cloudAttr' selection as being not general enough

- too much 'hidden' functionality
parent b67ddcf1
......@@ -25,10 +25,6 @@ without any user intervention:
// No additional clouds
clouds ();
// No additional cloud attributes to write. Choices:
// - Us = Slip velocity Us = U - Uc
cloudAttrs ();
}
......
......@@ -50,10 +50,6 @@ write
// Clouds
clouds ();
// Additional cloud attributes to write. Choices:
// - Us = Slip velocity Us = U - Uc
cloudAttrs ();
}
// Items to suppress from writing
......@@ -74,7 +70,6 @@ regions
{
fields ();
clouds ();
cloudAttrs ();
}
ignore
{
......
......@@ -94,10 +94,10 @@ class adiosCoreWrite
void read(const dictionary&);
//- Disallow default bitwise copy construct
adiosCoreWrite(const adiosCoreWrite&);
adiosCoreWrite(const adiosCoreWrite&) = delete;
//- Disallow default bitwise assignment
void operator=(const adiosCoreWrite&);
void operator=(const adiosCoreWrite&) = delete;
protected:
......
......@@ -38,12 +38,10 @@ SourceFiles
#include "IBufStream.H"
#include "DynamicCharList.H"
#include "HashTable.H"
#include "Ostream.H"
#include "adios.h"
#include "adios_read.h"
#include "adiosTime.H"
#include "ParcelEncoding.H"
......@@ -91,17 +89,17 @@ private:
// Private Member Functions
//- Disallow default bitwise copy construct
adiosReader(const adiosReader&);
//- Disallow default bitwise assignment
void operator=(const adiosReader&);
//- scan opened file for variables/attributes
void scan(bool verbose=false);
void select(ADIOS_SELECTION *sel);
//- Disallow default bitwise copy construct
adiosReader(const adiosReader&) = delete;
//- Disallow default bitwise assignment
void operator=(const adiosReader&) = delete;
public:
// Constructors
......@@ -260,12 +258,12 @@ class adiosReader::VarInfo
// Private Member Functions
//- Disallow default bitwise assignment
void operator=(const VarInfo&);
//- Read variable information from bp file
bool readInfo(ADIOS_FILE *file, bool verbose=false);
//- Disallow default bitwise assignment
void operator=(const VarInfo&) = delete;
public:
// Constructors
......@@ -304,6 +302,7 @@ public:
};
//- Field information
class adiosReader::fieldInfo
:
public fileName
......@@ -368,7 +367,7 @@ public:
};
// currently looks mostly identical to fieldInfo, but this will change
//- Cloud information.
class adiosReader::cloudInfo
:
public fileName
......@@ -401,11 +400,7 @@ public:
cloudInfo();
cloudInfo(const fileName& varName);
cloudInfo
(
const adiosReader::VarInfo& varinfo,
const adiosReader& reader
);
cloudInfo(const adiosReader::VarInfo&, const adiosReader&);
//- The region name is before the first /
......
......@@ -25,7 +25,6 @@ License
#include "adiosWrite.H"
#include "CStringList.H"
#include "nullObject.H"
#include "FlatListOutput.H"
#include "ParcelEncoding.H"
......@@ -86,7 +85,7 @@ template<class CloudType>
Foam::label Foam::adiosWrite::writeCloud
(
const CloudType& cld,
const regionInfo& rInfo
const bool expandCloud
)
{
typedef OCompactCountStream CloudCountStream;
......@@ -224,34 +223,28 @@ Foam::label Foam::adiosWrite::writeCloud
defineListAttribute("offset", varName, encoded.offsets());
defineListAttribute("byte-size", varName, encoded.sizes());
if (isNull(rInfo))
{
return nParcels;
}
//
// The rest is only if we want expansion
//
// Only if we want expansion
if (expandCloud)
{
// common - local offset value
const string offsetDims = Foam::name(cInfo.offset());
// common - local offset value
const string offsetDims = Foam::name(cInfo.offset());
// for scalars
const string localDims = Foam::name(nParcels);
const string globalDims = Foam::name(cInfo.nTotal());
// for scalars
const string localDims = Foam::name(nParcels);
const string globalDims = Foam::name(cInfo.nTotal());
// for vectors
const string localDims3 = localDims + ",3";
const string globalDims3 = globalDims + ",3";
// for vectors
const string localDims3 = localDims + ",3";
const string globalDims3 = globalDims + ",3";
// expand parcel contents into separate fields - runtime selectable
// mostly useful for debugging and as a general example
// expand parcel contents into separate fields - runtime selectable
// mostly useful for debugging and as a general example
DynamicList<label> labelBuffer;
DynamicList<scalar> scalarBuffer;
DynamicList<label> labelBuffer;
DynamicList<scalar> scalarBuffer;
if (rInfo.expandCloud_)
{
labelBuffer.reserve(nParcels);
scalarBuffer.reserve(3*nParcels);
......@@ -349,43 +342,6 @@ Foam::label Foam::adiosWrite::writeCloud
}
}
// other additional output - not generalizable
// Write slip velocity Us = U - Uc
// Cannot be in the template!
// eg, error: 'const class Foam::indexedParticle' has no member named 'Uc'
#if 0
{
const word what = "Us";
if (findStrings(rInfo.requestedAttrs_, what))
{
scalarBuffer.reserve(3*nParcels);
scalarBuffer.setSize(3*nParcels); // size for 'vector'
label i = 0;
forAllConstIter(typename CloudType, cld, pIter)
{
scalarBuffer[3*i+0] = pIter().U().x() - pIter().Uc().x();
scalarBuffer[3*i+1] = pIter().U().y() - pIter().Uc().y();
scalarBuffer[3*i+2] = pIter().U().z() - pIter().Uc().z();
++i;
}
defineVariable
(
varName/"Us",
adiosTraits<scalar>::adiosType,
localDims3,
globalDims3,
offsetDims
);
writeVariable(varName/what, scalarBuffer);
}
}
#endif
return nParcels;
}
......@@ -398,7 +354,7 @@ Foam::label Foam::adiosWrite::printCloud
const CloudType& cld
)
{
cloudInfo cInfo(cld.name(), cld.type());
cloudInfo cInfo(cld);
// Number of parcels on this process
const label nParcels = cld.size();
......
......@@ -57,10 +57,6 @@ void Foam::adiosWrite::regionInfo::read
{
wrtDict.lookup("clouds") >> requestedClouds_;
}
if (explicitWrite_ || wrtDict.found("cloudAttrs"))
{
wrtDict.lookup("cloudAttrs") >> requestedAttrs_;
}
if (ignDict.found("fields"))
{
......@@ -115,7 +111,6 @@ void Foam::adiosWrite::regionInfo::resetAll()
requestedClouds_.clear();
ignoredFields_.clear();
ignoredClouds_.clear();
requestedAttrs_.clear();
expandCloud_ = false;
}
......@@ -137,8 +132,7 @@ Foam::adiosWrite::regionInfo::regionInfo
topoTime0_(0),
pointTime0_(0),
requestedClouds_(),
ignoredClouds_(),
requestedAttrs_()
ignoredClouds_()
{
read(mesh, dict);
......
......@@ -560,7 +560,7 @@ Foam::label Foam::adiosWrite::writeClouds(const regionInfo& rInfo)
if (rInfo.acceptCloudObject(obj))
{
label nParcels = writeCloudObject(obj, rInfo);
label nParcels = writeCloudObject(obj, rInfo.expandCloud_);
if (nParcels > 0)
{
cloudNames.append(name);
......
......@@ -108,13 +108,14 @@ class adiosWrite
label nextWrite_;
label timeSteps_;
// Private Member Functions
//- Disallow default bitwise copy construct
adiosWrite(const adiosWrite&);
adiosWrite(const adiosWrite&) = delete;
//- Disallow default bitwise assignment
void operator=(const adiosWrite&);
void operator=(const adiosWrite&) = delete;
protected:
......@@ -192,7 +193,7 @@ protected:
label writeCloudObject
(
const regIOobject& obj,
const regionInfo& rInfo
const bool expandCloud = false
);
//- Define/write ADIOS cloud variables/attributes for a given type
......@@ -201,7 +202,7 @@ protected:
label writeCloud
(
const CloudType& cld,
const regionInfo& rInfo
const bool expandCloud = false
);
//- Print cloud (debug only)
......@@ -278,21 +279,44 @@ class adiosWrite::cloudInfo
:
public fileName
{
//- Type of the cloud
const word type_;
// Private Data
//- Type of the cloud
const word type_;
//- Total number of parcels (sum of nParcels_ list)
label nTotal_;
//- Array containing number of parcels per process (often used list)
List<label> nParcels_;
// Private Member Functions
//- Set the number of parcels and sync across processes
// Return the overall total
void set(label n)
{
// The number of parcels on each process
nParcels_[Pstream::myProcNo()] = n;
Pstream::gatherList(nParcels_);
Pstream::scatterList(nParcels_);
// Sum total number of parcels on all processes
nTotal_ = sum(nParcels_);
}
//- Total number of parcels (sum of nParcels_ list)
label nTotal_;
//- Disallow default bitwise assignment
cloudInfo(const cloudInfo&) = delete;
//- Array containing number of parcels per process (often used list)
List<label> nParcels_;
//- Disallow default bitwise assignment
void operator=(const cloudInfo&) = delete;
cloudInfo(const cloudInfo&) = delete;
void operator=(const cloudInfo&) = delete;
public:
//- Construct using names from regIOobject
//- Construct from cloud regIOobject
explicit cloudInfo(const regIOobject& cloud)
:
fileName
......@@ -305,13 +329,12 @@ public:
),
type_(cloud.type()),
nTotal_(0),
nParcels_(Pstream::nProcs())
{
reset();
}
nParcels_(Pstream::nProcs(), 0)
{}
~cloudInfo() {}
~cloudInfo()
{}
//- The region name is before the first /
......@@ -360,14 +383,7 @@ public:
// Return the overall total
label nParcels(label n)
{
// The number of parcels on each process
nParcels_[Pstream::myProcNo()] = n;
Pstream::gatherList(nParcels_);
Pstream::scatterList(nParcels_);
// Sum total number of parcels on all processes
nTotal_ = sum(nParcels_);
set(n);
return nTotal_;
}
......@@ -384,17 +400,6 @@ public:
return off;
}
//- Reset to zeros
void reset()
{
nTotal_ = 0;
forAll(nParcels_, i)
{
nParcels_[i] = 0;
}
}
};
......@@ -443,9 +448,6 @@ public:
//- Names of clouds to ignored
wordReList ignoredClouds_;
//- Additional attributes to write for cloud parcel data
wordReList requestedAttrs_;
//- Normally don't want to expand cloud (debug only)
Switch expandCloud_;
......@@ -465,7 +467,8 @@ public:
);
~regionInfo() {};
~regionInfo()
{}
//- If auto-write is in effect
......
......@@ -37,7 +37,7 @@ License
Foam::label Foam::adiosWrite::writeCloudObject
(
const regIOobject& obj,
const regionInfo& rInfo
const bool expandCloud
)
{
label nParcels = -1;
......@@ -49,7 +49,7 @@ Foam::label Foam::adiosWrite::writeCloudObject
nParcels = writeCloud
(
static_cast<const Cloud<indexedParticle>&>(obj),
rInfo
expandCloud
);
}
else if (cloudType == Cloud<passiveParticle>::typeName)
......@@ -57,7 +57,7 @@ Foam::label Foam::adiosWrite::writeCloudObject
nParcels = writeCloud
(
static_cast<const Cloud<passiveParticle>&>(obj),
rInfo
expandCloud
);
}
else if (cloudType == Cloud<basicKinematicCollidingParcel>::typeName)
......@@ -65,7 +65,7 @@ Foam::label Foam::adiosWrite::writeCloudObject
nParcels = writeCloud
(
static_cast<const Cloud<basicKinematicCollidingParcel>&>(obj),
rInfo
expandCloud
);
}
else if (cloudType == Cloud<basicKinematicMPPICParcel>::typeName)
......@@ -74,7 +74,7 @@ Foam::label Foam::adiosWrite::writeCloudObject
(
// using alternative
static_cast<const Cloud<basicKinematicParcel>&>(obj),
rInfo
expandCloud
);
}
else if (cloudType == Cloud<basicKinematicParcel>::typeName)
......@@ -82,7 +82,7 @@ Foam::label Foam::adiosWrite::writeCloudObject
nParcels = writeCloud
(
static_cast<const Cloud<basicKinematicParcel>&>(obj),
rInfo
expandCloud
);
}
else if (cloudType == Cloud<basicReactingMultiphaseParcel>::typeName)
......@@ -90,7 +90,7 @@ Foam::label Foam::adiosWrite::writeCloudObject
nParcels = writeCloud
(
static_cast<const Cloud<basicReactingMultiphaseParcel>&>(obj),
rInfo
expandCloud
);
}
else if (cloudType == Cloud<basicReactingParcel>::typeName)
......@@ -98,7 +98,7 @@ Foam::label Foam::adiosWrite::writeCloudObject
nParcels = writeCloud
(
static_cast<const Cloud<basicReactingParcel>&>(obj),
rInfo
expandCloud
);
}
// else if (cloudType == Cloud<basicThermoParcel>::typeName)
......@@ -107,7 +107,7 @@ Foam::label Foam::adiosWrite::writeCloudObject
nParcels = writeCloud
(
static_cast<const Cloud<molecule>&>(obj),
rInfo
expandCloud
);
}
// else if (cloudType == Cloud<solidParticle>::typeName)
......@@ -116,7 +116,7 @@ Foam::label Foam::adiosWrite::writeCloudObject
nParcels = writeCloud
(
static_cast<const Cloud<basicSprayParcel>&>(obj),
rInfo
expandCloud
);
}
......
......@@ -37,12 +37,8 @@ write
// Volume fields
fields ();
// Kinematic clouds
// Parcel clouds
clouds ();
// Additional cloud attributes to write. Choices:
// - Us = Slip velocity Us = U - Uc
cloudAttrs ();
}
// Items to suppress from writing
......@@ -64,7 +60,6 @@ regions
{
fields ();
clouds ();
cloudAttrs ();
}
ignore
{
......
......@@ -37,12 +37,8 @@ write
// Volume fields
fields ();
// Kinematic clouds
// Parcel clouds
clouds ();
// Additional cloud attributes to write. Choices:
// - Us = Slip velocity Us = U - Uc
cloudAttrs ();
}
// Items to suppress from writing
......@@ -64,7 +60,6 @@ regions
{
fields ();
clouds ();
cloudAttrs ();
}
ignore
{
......
......@@ -37,12 +37,8 @@ write
// Volume fields
fields ();
// Kinematic clouds
// Parcel clouds
clouds ();
// Additional cloud attributes to write. Choices:
// - Us = Slip velocity Us = U - Uc
cloudAttrs ();
}
// Items to suppress from writing
......@@ -64,7 +60,6 @@ regions
{
fields ();
clouds ();
cloudAttrs ();
}
ignore
{
......
......@@ -37,12 +37,8 @@ write
// Volume fields
fields ();
// Kinematic clouds
// Parcel clouds
clouds ();
// Additional cloud attributes to write. Choices:
// - Us = Slip velocity Us = U - Uc
cloudAttrs ();
}
// Items to suppress from writing
......@@ -64,7 +60,6 @@ regions
{
fields ();
clouds ();
cloudAttrs ();
}
ignore
{
......
......@@ -40,12 +40,8 @@ write
// Volume fields
fields ();
// Kinematic clouds
// Parcel clouds
clouds ();
// Additional cloud attributes to write. Choices:
// - Us = Slip velocity Us = U - Uc
cloudAttrs ();
}
// Items to suppress from writing
......@@ -67,7 +63,6 @@ regions
{
fields ();
clouds ();
cloudAttrs ();
}
ignore
{
......
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