GIT: Initial state after latest Foundation merge

This commit is contained in:
Andrew Heather
2016-09-20 14:49:08 +01:00
4571 changed files with 115696 additions and 74609 deletions

View File

@ -19,4 +19,3 @@ cloudName reactingCloud1Tracks;
fields ( d U T );
// ************************************************************************* //

View File

@ -147,7 +147,7 @@ int main(int argc, char *argv[])
PtrList<passiveParticle> particles(0);
// transfer particles to (more convenient) list
// Transfer particles to (more convenient) list
{
passiveParticleCloud ppc(mesh, cloudName);
Info<< "\n Read " << returnReduce(ppc.size(), sumOp<label>())
@ -199,7 +199,7 @@ int main(int argc, char *argv[])
{
Info<< "\n Generating " << nTracks << " tracks" << endl;
// determine length of each track
// Determine length of each track
labelList trackLengths(nTracks, 0);
forAll(particleToTrack, i)
{
@ -207,7 +207,7 @@ int main(int argc, char *argv[])
trackLengths[trackI]++;
}
// particle "age" property used to sort the tracks
// Particle "age" property used to sort the tracks
List<SortableList<scalar>> agePerTrack(nTracks);
List<List<label>> particleMap(nTracks);
@ -218,7 +218,7 @@ int main(int argc, char *argv[])
particleMap[i].setSize(length);
}
// store the particle age per track
// Store the particle age per track
IOobjectList cloudObjs
(
mesh,
@ -230,8 +230,11 @@ int main(int argc, char *argv[])
{
tmp<scalarField> tage =
readParticleField<scalar>("age", cloudObjs);
const scalarField& age = tage();
List<label> trackSamples(nTracks, 0);
forAll(particleToTrack, i)
{
const label trackI = particleToTrack[i];
@ -269,7 +272,7 @@ int main(int argc, char *argv[])
labelList& particleIds = particleMap[i];
{
// update addressing
// Update addressing
List<label> sortedIds(ids);
forAll(sortedIds, j)
{
@ -289,7 +292,7 @@ int main(int argc, char *argv[])
}
// write track (line) connectivity to file
// Write track (line) connectivity to file
Info<< "\n Writing track lines" << endl;
os << "\nLINES " << nTracks << ' ' << nPoints + nTracks << nl;

View File

@ -27,22 +27,17 @@ License
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class Type>
bool fieldOk(const IOobjectList& cloudObjs, const word& name)
bool Foam::fieldOk(const IOobjectList& cloudObjs, const word& name)
{
IOobjectList objects(cloudObjs.lookupClass(IOField<Type>::typeName));
return (objects.lookup(name) != NULL);
return (objects.lookup(name) != nullptr);
}
template<class Type>
tmp<Field<Type>> readParticleField
Foam::tmp<Foam::Field<Type>> Foam::readParticleField
(
const word& name,
const IOobjectList cloudObjs
@ -51,7 +46,7 @@ tmp<Field<Type>> readParticleField
IOobjectList objects(cloudObjs.lookupClass(IOField<Type>::typeName));
const IOobject* obj = objects.lookup(name);
if (obj != NULL)
if (obj != nullptr)
{
IOField<Type> newField(*obj);
return tmp<Field<Type>>(new Field<Type>(newField.xfer()));
@ -66,7 +61,7 @@ tmp<Field<Type>> readParticleField
template<class Type>
void readFields
void Foam::readFields
(
PtrList<List<Type>>& values,
const List<word>& fieldNames,
@ -78,7 +73,7 @@ void readFields
forAll(fieldNames, j)
{
const IOobject* obj = objects.lookup(fieldNames[j]);
if (obj != NULL)
if (obj != nullptr)
{
Info<< " reading field " << fieldNames[j] << endl;
IOField<Type> newField(*obj);
@ -95,7 +90,7 @@ void readFields
template<class Type>
void writeVTK(OFstream& os, const Type& value)
void Foam::writeVTK(OFstream& os, const Type& value)
{
os << value.component(0);
for (label i=1; i<pTraits<Type>::nComponents; i++)
@ -106,7 +101,7 @@ void writeVTK(OFstream& os, const Type& value)
template<class Type>
void writeVTKFields
void Foam::writeVTKFields
(
OFstream& os,
const PtrList<List<Type>>& values,
@ -116,10 +111,10 @@ void writeVTKFields
{
label step = max(floor(8/pTraits<Type>::nComponents), 1);
forAll(values, fieldI)
forAll(values, fieldi)
{
Info<< " writing field " << fieldNames[fieldI] << endl;
os << nl << fieldNames[fieldI] << ' '
Info<< " writing field " << fieldNames[fieldi] << endl;
os << nl << fieldNames[fieldi] << ' '
<< int(pTraits<Type>::nComponents) << ' '
<< values[fieldI].size() << " float" << nl;
label offset = 0;
@ -127,7 +122,7 @@ void writeVTKFields
{
const List<label> ids(addr[trackI]);
List<Type> data(UIndirectList<Type>(values[fieldI], ids));
List<Type> data(UIndirectList<Type>(values[fieldi], ids));
label nData = data.size() - 1;
forAll(data, i)
{
@ -148,7 +143,7 @@ void writeVTKFields
template<class Type>
void processFields
void Foam::processFields
(
OFstream& os,
const List<List<label>>& addr,
@ -164,7 +159,7 @@ void processFields
forAll(userFieldNames, i)
{
IOobject* obj = objects.lookup(userFieldNames[i]);
if (obj != NULL)
if (obj != nullptr)
{
fieldNames.append(obj->name());
}
@ -184,8 +179,5 @@ void processFields
}
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -39,42 +39,44 @@ namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
bool fieldOk(const IOobjectList& cloudObjs, const word& name);
template<class Type>
bool fieldOk(const IOobjectList& cloudObjs, const word& name);
template<class Type>
tmp<Field<Type>> readParticleField
(
const word& name,
const IOobjectList cloudObjs
);
template<class Type>
tmp<Field<Type>> readParticleField
(
const word& name,
const IOobjectList cloudObjs
);
template<class Type>
void readFields
(
PtrList<List<Type>>& values,
const List<word>& fields,
const IOobjectList& cloudObjs
);
template<class Type>
void readFields
(
PtrList<List<Type>>& values,
const List<word>& fields,
const IOobjectList& cloudObjs
);
template<class Type>
void writeVTK(OFstream& os, const Type& value);
template<class Type>
void writeVTK(OFstream& os, const Type& value);
template<class Type>
void writeVTKFields
(
OFstream& os,
const PtrList<List<Type>>& values,
const List<SortableList<scalar>>& agePerTrack,
const List<word>& fieldNames
);
template<class Type>
void writeVTKFields
(
OFstream& os,
const PtrList<List<Type>>& values,
const List<List<label>>& addr,
const List<word>& fieldNames
);
void processFields
(
OFstream& os,
const List<SortableList<scalar>>& agePerTrack,
const List<word>& userFieldNames,
const IOobjectList& cloudObjs
);
template<class Type>
void processFields
(
OFstream& os,
const List<List<label>>& addr,
const List<word>& userFieldNames,
const IOobjectList& cloudObjs
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //