Skip to content
Snippets Groups Projects
Commit d0955ba2 authored by Henry's avatar Henry
Browse files
parents 47c89757 afe1c4ff
Branches
Tags
No related merge requests found
......@@ -288,7 +288,7 @@ protected:
typename ParcelType::constantProperties constProps_;
//- Sub-models dictionary
const dictionary& subModelProperties_;
const dictionary subModelProperties_;
//- Random number generator - used by some injection routines
cachedRandom rndGen_;
......
......@@ -70,7 +70,7 @@ class particleForces
const fvMesh& mesh_;
//- The particleForces dictionary
const dictionary& dict_;
const dictionary dict_;
//- Gravity
const vector g_;
......
......@@ -72,32 +72,32 @@ Type Foam::fieldValues::cellSource::processValues
{
case opSum:
{
result = gSum(values);
result = sum(values);
break;
}
case opVolAverage:
{
result = gSum(values*V)/gSum(V);
result = sum(values*V)/sum(V);
break;
}
case opVolIntegrate:
{
result = gSum(values*V);
result = sum(values*V);
break;
}
case opWeightedAverage:
{
result = gSum(values*weightField)/gSum(weightField);
result = sum(values*weightField)/sum(weightField);
break;
}
case opMin:
{
result = gMin(values);
result = min(values);
break;
}
case opMax:
{
result = gMax(values);
result = max(values);
break;
}
default:
......@@ -119,19 +119,19 @@ bool Foam::fieldValues::cellSource::writeValues(const word& fieldName)
if (ok)
{
Field<Type> values(combineFields(setFieldValues<Type>(fieldName)));
Field<Type> values(setFieldValues<Type>(fieldName));
combineFields(values);
scalarField V(combineFields(filterField(mesh().V())));
scalarField V(filterField(mesh().V()));
combineFields(V);
scalarField weightField
(
combineFields(setFieldValues<scalar>(weightFieldName_))
);
Type result = processValues(values, V, weightField);
scalarField weightField(setFieldValues<scalar>(weightFieldName_));
combineFields(weightField);
if (Pstream::master())
{
Type result = processValues(values, V, weightField);
if (valueOutput_)
{
IOField<Type>
......
......@@ -91,32 +91,32 @@ Type Foam::fieldValues::faceSource::processValues
{
case opSum:
{
result = gSum(values);
result = sum(values);
break;
}
case opAreaAverage:
{
result = gSum(values*magSf)/gSum(magSf);
result = sum(values*magSf)/sum(magSf);
break;
}
case opAreaIntegrate:
{
result = gSum(values*magSf);
result = sum(values*magSf);
break;
}
case opWeightedAverage:
{
result = gSum(values*weightField)/gSum(weightField);
result = sum(values*weightField)/sum(weightField);
break;
}
case opMin:
{
result = gMin(values);
result = min(values);
break;
}
case opMax:
{
result = gMax(values);
result = max(values);
break;
}
default:
......@@ -150,18 +150,19 @@ bool Foam::fieldValues::faceSource::writeValues(const word& fieldName)
else
{
// Get unoriented magSf
magSf = combineFields(filterField(mesh().magSf(), false));
magSf = filterField(mesh().magSf(), false);
}
// Combine onto master
values = combineFields(values);
magSf = combineFields(magSf);
weightField = combineFields(weightField);
combineFields(values);
combineFields(magSf);
combineFields(weightField);
Type result = processValues(values, magSf, weightField);
if (Pstream::master())
{
Type result = processValues(values, magSf, weightField);
if (valueOutput_)
{
IOField<Type>
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -166,12 +166,11 @@ public:
//- Combine fields from all processor domains into single field
template<class Type>
tmp<Field<Type> > combineFields(const Field<Type>& field) const;
void combineFields(Field<Type>& field);
//- Combine fields from all processor domains into single field
template<class Type>
tmp<Field<Type> > combineFields(const tmp<Field<Type> >&) const;
void combineFields(tmp<Field<Type> >&);
};
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -30,10 +30,7 @@ License
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type>
Foam::tmp<Foam::Field<Type> > Foam::fieldValue::combineFields
(
const Field<Type>& field
) const
void Foam::fieldValue::combineFields(Field<Type>& field)
{
List<Field<Type> > allValues(Pstream::nProcs());
......@@ -43,32 +40,20 @@ Foam::tmp<Foam::Field<Type> > Foam::fieldValue::combineFields
if (Pstream::master())
{
return tmp<Field<Type> >
(
new Field<Type>
field =
ListListOps::combine<Field<Type> >
(
ListListOps::combine<Field<Type> >
(
allValues,
accessOp<Field<Type> >()
)
)
);
}
else
{
return field;
allValues,
accessOp<Field<Type> >()
);
}
}
template<class Type>
Foam::tmp<Foam::Field<Type> > Foam::fieldValue::combineFields
(
const tmp<Field<Type> >& field
) const
void Foam::fieldValue::combineFields(tmp<Field<Type> >& field)
{
return combineFields(field());
combineFields(field());
}
......
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