Merge branch 'master' into splitCyclic

Conflicts:
	applications/utilities/mesh/manipulation/splitMeshRegions/splitMeshRegions.C
	applications/utilities/parallelProcessing/decomposePar/domainDecompositionMesh.C
	src/OpenFOAM/db/IOstreams/Pstreams/UPstream.H
	src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchField.C
	src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaces/cyclicGAMGInterface/cyclicGAMGInterface.C
	src/OpenFOAM/meshes/pointMesh/pointPatches/constraint/processor/processorPointPatch.H
	src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/cyclic/cyclicPolyPatch.H
	src/OpenFOAM/meshes/polyMesh/syncTools/syncTools.C
	src/OpenFOAM/meshes/polyMesh/syncTools/syncToolsTemplates.C
	src/meshTools/sets/topoSets/faceSet.C
	src/parallel/decompose/decompositionMethods/decompositionMethod/decompositionMethod.C
This commit is contained in:
mattijs
2010-04-16 12:09:34 +01:00
5841 changed files with 78171 additions and 41256 deletions

View File

@ -8,10 +8,10 @@
License
This file is part of OpenFOAM.
OpenFOAM is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
@ -19,8 +19,7 @@ License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Typedef
Foam::IOcellSource

View File

@ -8,10 +8,10 @@
License
This file is part of OpenFOAM.
OpenFOAM is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
@ -19,43 +19,38 @@ License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "cellSource.H"
#include "fvMesh.H"
#include "volFields.H"
#include "IOList.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
defineTypeNameAndDebug(Foam::fieldValues::cellSource, 0);
template<>
const char* Foam::NamedEnum<Foam::fieldValues::cellSource::sourceType, 1>::
names[] =
{
namespace fieldValues
{
defineTypeNameAndDebug(cellSource, 0);
}
"cellZone"
};
template<>
const char* NamedEnum<fieldValues::cellSource::sourceType, 1>::
names[] = {"cellZone"};
const Foam::NamedEnum<Foam::fieldValues::cellSource::sourceType, 1>
Foam::fieldValues::cellSource::sourceTypeNames_;
const NamedEnum<fieldValues::cellSource::sourceType, 1>
fieldValues::cellSource::sourceTypeNames_;
template<>
const char* Foam::NamedEnum<Foam::fieldValues::cellSource::operationType, 7>::
names[] =
{
"none", "sum", "volAverage",
"volIntegrate", "weightedAverage", "min", "max"
};
template<>
const char* NamedEnum<fieldValues::cellSource::operationType, 5>::
names[] =
{
"none", "sum", "volAverage", "volIntegrate", "weightedAverage"
};
const NamedEnum<fieldValues::cellSource::operationType, 5>
fieldValues::cellSource::operationTypeNames_;
}
const Foam::NamedEnum<Foam::fieldValues::cellSource::operationType, 7>
Foam::fieldValues::cellSource::operationTypeNames_;
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
@ -85,10 +80,11 @@ void Foam::fieldValues::cellSource::setCellZoneCells()
}
cellId_.setSize(count);
nCells_ = returnReduce(cellId_.size(), sumOp<label>());
if (debug)
{
Info<< "Original cell zone size = " << cZone.size()
Pout<< "Original cell zone size = " << cZone.size()
<< ", new size = " << count << endl;
}
}
@ -114,8 +110,8 @@ void Foam::fieldValues::cellSource::initialise(const dictionary& dict)
}
Info<< type() << " " << name_ << ":" << nl
<< " total cells = " << cellId_.size() << nl
<< " total volume = " << sum(filterField(mesh().V()))
<< " total cells = " << nCells_ << nl
<< " total volume = " << gSum(filterField(mesh().V()))
<< nl << endl;
if (operation_ == opWeightedAverage)
@ -149,7 +145,7 @@ void Foam::fieldValues::cellSource::writeFileHeader()
{
outputFilePtr_()
<< "# Source : " << sourceTypeNames_[source_] << " "
<< sourceName_ << nl << "# Cells : " << cellId_.size() << nl
<< sourceName_ << nl << "# Cells : " << nCells_ << nl
<< "# Time" << tab << "sum(V)";
forAll(fields_, i)
@ -177,6 +173,7 @@ Foam::fieldValues::cellSource::cellSource
fieldValue(name, obr, dict, loadFromFiles),
source_(sourceTypeNames_.read(dict.lookup("source"))),
operation_(operationTypeNames_.read(dict.lookup("operation"))),
nCells_(0),
cellId_()
{
read(dict);
@ -239,4 +236,3 @@ void Foam::fieldValues::cellSource::write()
// ************************************************************************* //

View File

@ -8,10 +8,10 @@
License
This file is part of OpenFOAM.
OpenFOAM is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
@ -19,8 +19,7 @@ License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::fieldValues::cellSource
@ -104,16 +103,18 @@ public:
opSum,
opVolAverage,
opVolIntegrate,
opWeightedAverage
opWeightedAverage,
opMin,
opMax
};
//- Operation type names
static const NamedEnum<operationType, 5> operationTypeNames_;
static const NamedEnum<operationType, 7> operationTypeNames_;
private:
// Private member functions
// Private Member Functions
//- Set cells to evaluate based on a cell zone
void setCellZoneCells();
@ -132,6 +133,9 @@ protected:
//- Operation to apply to values
operationType operation_;
//- Global number of cells
label nCells_;
//- Local list of cell IDs
labelList cellId_;
@ -139,7 +143,7 @@ protected:
word weightFieldName_;
// Protected member functions
// Protected Member Functions
//- Initialise, e.g. cell addressing
void initialise(const dictionary& dict);
@ -188,7 +192,7 @@ public:
virtual ~cellSource();
// Public member functions
// Public Member Functions
// Access

View File

@ -8,10 +8,10 @@
License
This file is part of OpenFOAM.
OpenFOAM is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
@ -19,8 +19,7 @@ License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/

View File

@ -8,10 +8,10 @@
License
This file is part of OpenFOAM.
OpenFOAM is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
@ -19,8 +19,7 @@ License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Typedef
Foam::cellSourceFunctionObject

View File

@ -8,10 +8,10 @@
License
This file is part of OpenFOAM.
OpenFOAM is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
@ -19,8 +19,7 @@ License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/

View File

@ -8,10 +8,10 @@
License
This file is part of OpenFOAM.
OpenFOAM is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
@ -19,14 +19,12 @@ License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "cellSource.H"
#include "volFields.H"
#include "IOList.H"
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
@ -92,6 +90,16 @@ Type Foam::fieldValues::cellSource::processValues
result = sum(values*weightField)/sum(weightField);
break;
}
case opMin:
{
result = min(values);
break;
}
case opMax:
{
result = max(values);
break;
}
default:
{
// Do nothing
@ -124,7 +132,7 @@ bool Foam::fieldValues::cellSource::writeValues(const word& fieldName)
if (valueOutput_)
{
IOList<Type>
IOField<Type>
(
IOobject
(

View File

@ -37,29 +37,39 @@ writeFormat ascii;
writePrecision 6;
writeCompression uncompressed;
writeCompression off;
timeFormat general;
timePrecision 6;
runTimeModifiable yes;
runTimeModifiable true;
functions
(
{
faceObj1
{
type faceSource;
functionObjectLibs ("libfieldFunctionObjects.so");
enabled true;
outputControl outputTime;
// Output to log&file (true) or to file only
log true;
// Output field values as well
valueOutput true;
// Patch or faceZone to sample
source patch;
sourceName movingWall;
// source faceZone;
// sourceName f0;
// Operation: areaAverage/sum/weightedAverage ...
operation areaAverage;
fields
(
p
@ -79,6 +89,7 @@ functions
source faceZone;
sourceName f0;
operation sum;
fields
(
phi
@ -96,13 +107,13 @@ functions
source cellZone;
sourceName c0;
operation volAverage;
fields
(
p
U
);
}
);
}
// ************************************************************************* //

View File

@ -8,10 +8,10 @@
License
This file is part of OpenFOAM.
OpenFOAM is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
@ -19,8 +19,7 @@ License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Typedef
Foam::IOfaceSource

View File

@ -8,10 +8,10 @@
License
This file is part of OpenFOAM.
OpenFOAM is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
@ -19,8 +19,7 @@ License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
@ -31,35 +30,32 @@ License
#include "coupledPolyPatch.H"
#include "surfaceFields.H"
#include "volFields.H"
#include "IOList.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
defineTypeNameAndDebug(Foam::fieldValues::faceSource, 0);
template<>
const char* Foam::NamedEnum<Foam::fieldValues::faceSource::sourceType, 2>::
names[] =
{
namespace fieldValues
{
defineTypeNameAndDebug(faceSource, 0);
}
"faceZone", "patch"
};
template<>
const char* NamedEnum<fieldValues::faceSource::sourceType, 2>::
names[] = {"faceZone", "patch"};
const Foam::NamedEnum<Foam::fieldValues::faceSource::sourceType, 2>
Foam::fieldValues::faceSource::sourceTypeNames_;
const NamedEnum<fieldValues::faceSource::sourceType, 2>
fieldValues::faceSource::sourceTypeNames_;
template<>
const char* NamedEnum<fieldValues::faceSource::operationType, 5>::
names[] =
{
"none", "sum", "areaAverage", "areaIntegrate", "weightedAverage"
};
template<>
const char* Foam::NamedEnum<Foam::fieldValues::faceSource::operationType, 7>::
names[] =
{
"none", "sum", "areaAverage",
"areaIntegrate", "weightedAverage", "min", "max"
};
const NamedEnum<fieldValues::faceSource::operationType, 5>
fieldValues::faceSource::operationTypeNames_;
}
const Foam::NamedEnum<Foam::fieldValues::faceSource::operationType, 7>
Foam::fieldValues::faceSource::operationTypeNames_;
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
@ -82,7 +78,7 @@ void Foam::fieldValues::faceSource::setFaceZoneFaces()
faceId_.setSize(fZone.size());
facePatchId_.setSize(fZone.size());
flipMap_.setSize(fZone.size());
faceSign_.setSize(fZone.size());
label count = 0;
forAll(fZone, i)
@ -126,11 +122,11 @@ void Foam::fieldValues::faceSource::setFaceZoneFaces()
{
if (fZone.flipMap()[i])
{
flipMap_[count] = -1;
faceSign_[count] = -1;
}
else
{
flipMap_[count] = 1;
faceSign_[count] = 1;
}
faceId_[count] = faceId;
facePatchId_[count] = facePatchId;
@ -140,11 +136,12 @@ void Foam::fieldValues::faceSource::setFaceZoneFaces()
faceId_.setSize(count);
facePatchId_.setSize(count);
flipMap_.setSize(count);
faceSign_.setSize(count);
nFaces_ = returnReduce(faceId_.size(), sumOp<label>());
if (debug)
{
Info<< "Original face zone size = " << fZone.size()
Pout<< "Original face zone size = " << fZone.size()
<< ", new size = " << count << endl;
}
}
@ -179,13 +176,14 @@ void Foam::fieldValues::faceSource::setPatchFaces()
faceId_.setSize(nFaces);
facePatchId_.setSize(nFaces);
flipMap_.setSize(nFaces);
faceSign_.setSize(nFaces);
nFaces_ = returnReduce(faceId_.size(), sumOp<label>());
forAll(faceId_, faceI)
{
faceId_[faceI] = faceI;
facePatchId_[faceI] = patchId;
flipMap_[faceI] = 1;
faceSign_[faceI] = 1;
}
}
@ -208,7 +206,7 @@ void Foam::fieldValues::faceSource::initialise(const dictionary& dict)
}
default:
{
FatalErrorIn("faceSource::initiliase()")
FatalErrorIn("faceSource::initialise()")
<< type() << " " << name_ << ": "
<< sourceTypeNames_[source_] << "(" << sourceName_ << "):"
<< nl << " Unknown source type. Valid source types are:"
@ -217,8 +215,10 @@ void Foam::fieldValues::faceSource::initialise(const dictionary& dict)
}
Info<< type() << " " << name_ << ":" << nl
<< " total faces = " << faceId_.size() << nl
<< " total area = " << sum(filterField(mesh().magSf())) << nl;
<< " total faces = " << nFaces_
<< nl
<< " total area = " << gSum(filterField(mesh().magSf(), false))
<< nl;
if (operation_ == opWeightedAverage)
{
@ -252,7 +252,7 @@ void Foam::fieldValues::faceSource::writeFileHeader()
{
outputFilePtr_()
<< "# Source : " << sourceTypeNames_[source_] << " "
<< sourceName_ << nl << "# Faces : " << faceId_.size() << nl
<< sourceName_ << nl << "# Faces : " << nFaces_ << nl
<< "# Time" << tab << "sum(magSf)";
forAll(fields_, i)
@ -280,9 +280,10 @@ Foam::fieldValues::faceSource::faceSource
fieldValue(name, obr, dict, loadFromFiles),
source_(sourceTypeNames_.read(dict.lookup("source"))),
operation_(operationTypeNames_.read(dict.lookup("operation"))),
nFaces_(0),
faceId_(),
facePatchId_(),
flipMap_(),
faceSign_(),
weightFieldName_("undefinedWeightedFieldName")
{
read(dict);
@ -318,7 +319,7 @@ void Foam::fieldValues::faceSource::write()
{
outputFilePtr_()
<< obr_.time().value() << tab
<< sum(filterField(mesh().magSf()));
<< sum(filterField(mesh().magSf(), false));
}
forAll(fields_, i)

View File

@ -8,10 +8,10 @@
License
This file is part of OpenFOAM.
OpenFOAM is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
@ -19,8 +19,7 @@ License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::fieldValues::faceSource
@ -29,9 +28,9 @@ Description
Face source variant of field value function object. Values of user-
specified fields reported for collections of faces.
cellObj1 // Name also used to identify output folder
faceObj1 // Name also used to identify output folder
{
type cellSource;
type faceSource;
functionObjectLibs ("libfieldValueFunctionObjects.so");
enabled true;
outputControl outputTime;
@ -54,6 +53,15 @@ Description
- areaAverage
- areaIntegrate
- weightedAverage
- min
- max
Notes:
- faces on empty patches get ignored
- if the field is a volField the faceZone can only consist of boundary
faces.
- all fields get oriented according to the faceZone (so you might e.g. see
negative pressure)
SourceFiles
faceSource.C
@ -65,7 +73,6 @@ SourceFiles
#include "NamedEnum.H"
#include "fieldValue.H"
#include "labelList.H"
#include "surfaceFieldsFwd.H"
#include "volFieldsFwd.H"
@ -107,16 +114,18 @@ public:
opSum,
opAreaAverage,
opAreaIntegrate,
opWeightedAverage
opWeightedAverage,
opMin,
opMax
};
//- Operation type names
static const NamedEnum<operationType, 5> operationTypeNames_;
static const NamedEnum<operationType, 7> operationTypeNames_;
private:
// Private member functions
// Private Member Functions
//- Set faces to evaluate based on a face zone
void setFaceZoneFaces();
@ -135,20 +144,23 @@ protected:
//- Operation to apply to values
operationType operation_;
//- Global number of faces
label nFaces_;
//- Local list of face IDs
labelList faceId_;
//- Local list of patch ID per face
labelList facePatchId_;
//- List of +1/-1 representing face flip map
labelList flipMap_;
//- List of +1/-1 representing face flip map (1 use as is, -1 negate)
labelList faceSign_;
//- Weight field name - only used for opWeightedAverage mode
word weightFieldName_;
// Protected member functions
// Protected Member Functions
//- Initialise, e.g. face addressing
void initialise(const dictionary& dict);
@ -194,7 +206,7 @@ public:
virtual ~faceSource();
// Public member functions
// Public Member Functions
// Access
@ -208,7 +220,7 @@ public:
inline const labelList& facePatch() const;
//- Return the list of +1/-1 representing face flip map
inline const labelList& flipMap() const;
inline const labelList& faceSign() const;
// Function object functions
@ -227,14 +239,16 @@ public:
template<class Type>
tmp<Field<Type> > filterField
(
const GeometricField<Type, fvsPatchField, surfaceMesh>& field
const GeometricField<Type, fvsPatchField, surfaceMesh>& field,
const bool applyOrientation
) const;
//- Filter a volume field according to faceIds
template<class Type>
tmp<Field<Type> > filterField
(
const GeometricField<Type, fvPatchField, volMesh>& field
const GeometricField<Type, fvPatchField, volMesh>& field,
const bool applyOrientation
) const;
};

View File

@ -8,10 +8,10 @@
License
This file is part of OpenFOAM.
OpenFOAM is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
@ -19,8 +19,7 @@ License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/

View File

@ -8,10 +8,10 @@
License
This file is part of OpenFOAM.
OpenFOAM is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
@ -19,8 +19,7 @@ License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Typedef
Foam::faceSourceFunctionObject

View File

@ -8,10 +8,10 @@
License
This file is part of OpenFOAM.
OpenFOAM is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
@ -19,8 +19,7 @@ License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
@ -50,9 +49,9 @@ Foam::fieldValues::faceSource::facePatch() const
inline const Foam::labelList&
Foam::fieldValues::faceSource::flipMap() const
Foam::fieldValues::faceSource::faceSign() const
{
return flipMap_;
return faceSign_;
}

View File

@ -8,10 +8,10 @@
License
This file is part of OpenFOAM.
OpenFOAM is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
@ -19,15 +19,13 @@ License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "faceSource.H"
#include "surfaceFields.H"
#include "volFields.H"
#include "IOList.H"
#include "ListListOps.H"
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
@ -62,14 +60,14 @@ Foam::tmp<Foam::Field<Type> > Foam::fieldValues::faceSource::setFieldValues
if (obr_.foundObject<sf>(fieldName))
{
return filterField(obr_.lookupObject<sf>(fieldName));
return filterField(obr_.lookupObject<sf>(fieldName), true);
}
else if (obr_.foundObject<vf>(fieldName))
{
return filterField(obr_.lookupObject<vf>(fieldName));
return filterField(obr_.lookupObject<vf>(fieldName), true);
}
return tmp<Field<Type> >(new Field<Type>(0.0));
return tmp<Field<Type> >(new Field<Type>(0));
}
@ -104,6 +102,16 @@ Type Foam::fieldValues::faceSource::processValues
result = sum(values*weightField)/sum(weightField);
break;
}
case opMin:
{
result = min(values);
break;
}
case opMax:
{
result = max(values);
break;
}
default:
{
// Do nothing
@ -123,10 +131,13 @@ bool Foam::fieldValues::faceSource::writeValues(const word& fieldName)
if (ok)
{
// Get (correctly oriented) field
Field<Type> values = combineFields(setFieldValues<Type>(fieldName));
scalarField magSf = combineFields(filterField(mesh().magSf()));
// Get unoriented magSf
scalarField magSf = combineFields(filterField(mesh().magSf(), false));
// Get (correctly oriented) weighting field
scalarField weightField =
combineFields(setFieldValues<scalar>(weightFieldName_));
@ -136,7 +147,7 @@ bool Foam::fieldValues::faceSource::writeValues(const word& fieldName)
if (valueOutput_)
{
IOList<Type>
IOField<Type>
(
IOobject
(
@ -169,7 +180,8 @@ bool Foam::fieldValues::faceSource::writeValues(const word& fieldName)
template<class Type>
Foam::tmp<Foam::Field<Type> > Foam::fieldValues::faceSource::filterField
(
const GeometricField<Type, fvPatchField, volMesh>& field
const GeometricField<Type, fvPatchField, volMesh>& field,
const bool applyOrientation
) const
{
tmp<Field<Type> > tvalues(new Field<Type>(faceId_.size()));
@ -197,8 +209,14 @@ Foam::tmp<Foam::Field<Type> > Foam::fieldValues::faceSource::filterField
<< " Unable to process internal faces for volume field "
<< field.name() << nl << abort(FatalError);
}
}
values[i] *= flipMap_[i];
if (applyOrientation)
{
forAll(values, i)
{
values[i] *= faceSign_[i];
}
}
return tvalues;
@ -208,7 +226,8 @@ Foam::tmp<Foam::Field<Type> > Foam::fieldValues::faceSource::filterField
template<class Type>
Foam::tmp<Foam::Field<Type> > Foam::fieldValues::faceSource::filterField
(
const GeometricField<Type, fvsPatchField, surfaceMesh>& field
const GeometricField<Type, fvsPatchField, surfaceMesh>& field,
const bool applyOrientation
) const
{
tmp<Field<Type> > tvalues(new Field<Type>(faceId_.size()));
@ -226,8 +245,14 @@ Foam::tmp<Foam::Field<Type> > Foam::fieldValues::faceSource::filterField
{
values[i] = field[faceI];
}
}
values[i] *= flipMap_[i];
if (applyOrientation)
{
forAll(values, i)
{
values[i] *= faceSign_[i];
}
}
return tvalues;

View File

@ -8,10 +8,10 @@
License
This file is part of OpenFOAM.
OpenFOAM is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
@ -19,8 +19,7 @@ License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
@ -33,11 +32,6 @@ License
namespace Foam
{
defineTypeNameAndDebug(fieldValue, 0);
defineTemplateTypeNameAndDebug(IOList<vector>, 0);
defineTemplateTypeNameAndDebug(IOList<sphericalTensor>, 0);
defineTemplateTypeNameAndDebug(IOList<symmTensor>, 0);
defineTemplateTypeNameAndDebug(IOList<tensor>, 0);
}

View File

@ -8,10 +8,10 @@
License
This file is part of OpenFOAM.
OpenFOAM is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
@ -19,8 +19,7 @@ License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::fieldValue
@ -122,7 +121,7 @@ public:
virtual ~fieldValue();
// Public member functions
// Public Member Functions
// Access

View File

@ -8,10 +8,10 @@
License
This file is part of OpenFOAM.
OpenFOAM is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
@ -19,8 +19,7 @@ License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/

View File

@ -8,10 +8,10 @@
License
This file is part of OpenFOAM.
OpenFOAM is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
@ -19,8 +19,7 @@ License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/