mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'master' of /home/dm4/OpenFOAM/OpenFOAM-dev
This commit is contained in:
@ -69,13 +69,22 @@ public:
|
||||
// Member Functions
|
||||
|
||||
//- Sum surface field contributions to create cell values
|
||||
template<class Type>
|
||||
static tmp<GeometricField<Type, fvPatchField, volMesh> > weightedSum
|
||||
template<class Type, class WeightType>
|
||||
static
|
||||
tmp
|
||||
<
|
||||
GeometricField
|
||||
<
|
||||
typename outerProduct<WeightType, Type>::type,
|
||||
fvPatchField,
|
||||
volMesh
|
||||
>
|
||||
> weightedSum
|
||||
(
|
||||
const mapDistribute& map,
|
||||
const labelListList& stencil,
|
||||
const GeometricField<Type, fvPatchField, volMesh>& fld,
|
||||
const List<List<scalar> >& stencilWeights
|
||||
const List<List<WeightType> >& stencilWeights
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@ -27,25 +27,36 @@ License
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
Foam::tmp<Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh> >
|
||||
Foam::extendedCellToCellStencil::weightedSum
|
||||
template<class Type, class WeightType>
|
||||
Foam::tmp
|
||||
<
|
||||
Foam::GeometricField
|
||||
<
|
||||
typename Foam::outerProduct<WeightType, Type>::type,
|
||||
Foam::fvPatchField,
|
||||
Foam::volMesh
|
||||
>
|
||||
> Foam::extendedCellToCellStencil::weightedSum
|
||||
(
|
||||
const mapDistribute& map,
|
||||
const labelListList& stencil,
|
||||
const GeometricField<Type, fvPatchField, volMesh>& fld,
|
||||
const List<List<scalar> >& stencilWeights
|
||||
const List<List<WeightType> >& stencilWeights
|
||||
)
|
||||
{
|
||||
typedef typename outerProduct<WeightType, Type>::type WeightedType;
|
||||
typedef GeometricField<WeightedType, fvPatchField, volMesh>
|
||||
WeightedFieldType;
|
||||
|
||||
const fvMesh& mesh = fld.mesh();
|
||||
|
||||
// Collect internal and boundary values
|
||||
List<List<Type> > stencilFld;
|
||||
collectData(map, stencil, fld, stencilFld);
|
||||
|
||||
tmp<GeometricField<Type, fvPatchField, volMesh> > tsfCorr
|
||||
tmp<WeightedFieldType> twf
|
||||
(
|
||||
new GeometricField<Type, fvPatchField, volMesh>
|
||||
new WeightedFieldType
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
@ -62,23 +73,23 @@ Foam::extendedCellToCellStencil::weightedSum
|
||||
)
|
||||
)
|
||||
);
|
||||
GeometricField<Type, fvPatchField, volMesh>& sf = tsfCorr();
|
||||
WeightedFieldType& wf = twf();
|
||||
|
||||
// cells
|
||||
forAll(sf, cellI)
|
||||
forAll(wf, cellI)
|
||||
{
|
||||
const List<Type>& stField = stencilFld[cellI];
|
||||
const List<scalar>& stWeight = stencilWeights[cellI];
|
||||
const List<WeightType>& stWeight = stencilWeights[cellI];
|
||||
|
||||
forAll(stField, i)
|
||||
{
|
||||
sf[cellI] += stField[i]*stWeight[i];
|
||||
wf[cellI] += stWeight[i]*stField[i];
|
||||
}
|
||||
}
|
||||
|
||||
// Boundaries values?
|
||||
|
||||
return tsfCorr;
|
||||
return twf;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -116,11 +116,19 @@ public:
|
||||
}
|
||||
|
||||
//- Sum vol field contributions to create cell values
|
||||
template<class Type>
|
||||
tmp<GeometricField<Type, fvPatchField, volMesh> > weightedSum
|
||||
template<class Type, class WeightType>
|
||||
tmp
|
||||
<
|
||||
GeometricField
|
||||
<
|
||||
typename outerProduct<WeightType, Type>::type,
|
||||
fvPatchField,
|
||||
volMesh
|
||||
>
|
||||
> weightedSum
|
||||
(
|
||||
const GeometricField<Type, fvPatchField, volMesh>& fld,
|
||||
const List<List<scalar> >& stencilWeights
|
||||
const List<List<WeightType> >& stencilWeights
|
||||
) const
|
||||
{
|
||||
return weightedSum
|
||||
@ -131,7 +139,6 @@ public:
|
||||
stencilWeights
|
||||
);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -26,6 +26,7 @@ License
|
||||
#include "fieldValueDelta.H"
|
||||
#include "ListOps.H"
|
||||
#include "Time.H"
|
||||
#include "volFields.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
@ -38,16 +39,15 @@ namespace Foam
|
||||
|
||||
template<>
|
||||
const char*
|
||||
NamedEnum<fieldValues::fieldValueDelta::operationType, 5>::names[] =
|
||||
NamedEnum<fieldValues::fieldValueDelta::operationType, 4>::names[] =
|
||||
{
|
||||
"add",
|
||||
"subtract",
|
||||
"min",
|
||||
"max",
|
||||
"average"
|
||||
"max"
|
||||
};
|
||||
|
||||
const NamedEnum<fieldValues::fieldValueDelta::operationType, 5>
|
||||
const NamedEnum<fieldValues::fieldValueDelta::operationType, 4>
|
||||
fieldValues::fieldValueDelta::operationTypeNames_;
|
||||
}
|
||||
|
||||
@ -159,7 +159,7 @@ void Foam::fieldValues::fieldValueDelta::write()
|
||||
|
||||
if (log_)
|
||||
{
|
||||
Info<< type() << " " << name_ << " output:" << endl;
|
||||
Info<< type() << " output:" << endl;
|
||||
}
|
||||
|
||||
bool found = false;
|
||||
@ -180,8 +180,10 @@ void Foam::fieldValues::fieldValueDelta::write()
|
||||
{
|
||||
Info<< " none" << endl;
|
||||
}
|
||||
|
||||
Info<< endl;
|
||||
else
|
||||
{
|
||||
Info<< endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user