43 namespace functionObjects
53 void Foam::functionObjects::layerAverage::calcLayers()
56 DynamicList<label> startFaces;
57 DynamicList<layerInfo> startFacesInfo;
63 startFaces.append(pp.start() + j);
64 startFacesInfo.append(layerInfo(0, -1));
72 startFaces.append(fz[j]);
73 startFacesInfo.append(layerInfo(0, fz.flipMap()[j] ? -1 : +1));
80 FaceCellWave<layerInfo>
wave
95 if (allCellLayerInfo[celli].
valid(
wave.data()))
97 const label layeri = allCellLayerInfo[celli].cellLayer();
98 nLayers_ =
max(nLayers_, layeri + 1);
99 cellLayer_[celli] = layeri;
102 reduce(nLayers_, maxOp<label>());
107 Info<<
" Detected " << nLayers_ <<
" layers" <<
nl <<
endl;
117 tmp<volScalarField> cellLayer =
124 cellLayer.ref().primitiveFieldRef() = List<scalar>(cellLayer_);
125 cellLayer.ref().write();
137 layerCentre_.
setSize(nLayers_/2);
144 Foam::functionObjects::layerAverage::symmetricCoeff<Foam::vector>()
const
159 <<
"Symmetric layer average requested with "
161 <<
"averaging is only possible along coordinate axes."
174 Foam::functionObjects::layerAverage::symmetricCoeff<Foam::symmTensor>()
const
176 return sqr(symmetricCoeff<vector>());
182 Foam::functionObjects::layerAverage::symmetricCoeff<Foam::tensor>()
const
184 return symmetricCoeff<symmTensor>();
216 mesh_.boundaryMesh().patchSet
225 mesh_.faceZones().names()
228 if (patchIDs_.empty() && zoneIDs_.empty())
231 <<
"No patches or zones specified" <<
endl;
234 symmetric_ =
dict.lookupOrDefault<
bool>(
"symmetric",
false);
287 cannotFindObject(fields_[fieldi]);
292 #define DeclareTypeValueSets(Type, nullArg) \
293 PtrList<Field<Type>> Type##ValueSets(fieldNames.size());
295 #undef DeclareTypeValueSets
298 #define CollapseTypeFields(Type, nullArg) \
299 if (mesh_.foundObject<VolField<Type>>(fieldNames[fieldi])) \
301 const VolField<Type>& field = \
302 mesh_.lookupObject<VolField<Type>>(fieldNames[fieldi]); \
304 Type##ValueSets.set \
307 average(field.primitiveField()) \
311 #undef CollapseTypeFields
327 for (
label i = 1; i < layerCentre_.size(); ++ i)
330 layerDistance[i-1] +
mag(layerCentre_[i] - layerCentre_[i-1]);
372 if (&map.
mesh() == &mesh_)
382 if (&map.
mesh() == &mesh_)
395 if (&map.
mesh() == &mesh_)
Functions used by OpenFOAM that are specific to POSIX compliant operating systems and need to be repl...
#define forAll(list, i)
Loop across all elements in list.
Macros for easy insertion into run-time selection tables.
Generic GeometricField class.
static tmp< GeometricField< Type, PatchField, GeoMesh > > New(const word &name, const Internal &, const PtrList< PatchField< Type >> &)
Return a temporary field constructed from name,.
void append(const T &)
Append an element at the end of the list.
void setSize(const label)
Reset size of List.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
static bool master(const label communicator=0)
Am I the master process.
Holds list of sampling positions.
static const NamedEnum< axisType, 6 > axisTypeNames_
String representation of axis enums.
A list of keyword definitions, which are a keyword followed by any number of values (e....
A class for handling file names.
Abstract base-class for Time/database functionObjects.
Specialisation of Foam::functionObject for an Foam::fvMesh, providing a reference to the Foam::fvMesh...
const fvMesh & mesh_
Reference to the fvMesh.
virtual wordList fields() const
Return the list of fields required.
virtual void topoChange(const polyTopoChangeMap &)
Update topology using the given map.
virtual void distribute(const polyDistributionMap &)
Redistribute or update using the given distribution map.
virtual void mapMesh(const polyMeshMap &)
Update from another mesh using the given map.
virtual void movePoints(const polyMesh &)
Update for mesh point-motion.
layerAverage(const word &name, const Time &runTime, const dictionary &dict)
Construct from Time and dictionary.
virtual bool execute()
Do nothing.
virtual bool write()
Calculate and write the graphs.
virtual ~layerAverage()
Destructor.
virtual bool read(const dictionary &)
Read the field average data.
static const word outputPrefix
Directory prefix.
label nTotalCells() const
Return total number of cells in decomposed mesh.
Class containing mesh-to-mesh mapping information after a mesh distribution where we send parts of me...
const polyMesh & mesh() const
Return polyMesh.
Class containing mesh-to-mesh mapping information.
const polyMesh & mesh() const
Return polyMesh.
Mesh consisting of general polyhedral cells.
const meshFaceZones & faceZones() const
Return face zones.
const globalMeshData & globalData() const
Return parallel info.
static word defaultRegion
Return the default region name.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
const polyMesh & mesh() const
Return polyMesh.
const vectorField & cellCentres() const
static autoPtr< setWriter > New(const word &writeType, const IOstream::streamFormat writeFormat=IOstream::ASCII, const IOstream::compressionType writeCompression=IOstream::UNCOMPRESSED)
Select given write options.
A class for handling words, derived from string.
static const word null
An empty word.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
static List< word > fieldNames
#define FoundTypeField(Type, nullArg)
#define DeclareTypeValueSets(Type, nullArg)
#define TypeValueSetsParameter(Type, nullArg)
#define CollapseTypeFields(Type, nullArg)
#define WarningInFunction
Report a warning using Foam::Warning.
bool valid(const PtrList< ModelType > &l)
defineTypeNameAndDebug(adjustTimeStepToCombustion, 0)
addToRunTimeSelectionTable(functionObject, adjustTimeStepToCombustion, dictionary)
label wave(const fvMesh &mesh, const List< labelPair > &changedPatchAndFaces, const label nCorrections, GeometricField< scalar, PatchField, GeoMesh > &distance, TrackingData &td, GeometricField< DataType, PatchField, GeoMesh > &... data)
Wave distance (and maybe additional) data from faces. If nCorrections is.
errorManipArg< error, int > exit(error &err, const int errNo=1)
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
List< label > labelList
A List of labels.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
bool findStrings(const wordReListMatcher &matcher, const std::string &str)
Return true if string matches one of the regular expressions.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
bool mkDir(const fileName &, mode_t=0777)
Make a directory and return an error if it could not be created.
Ostream & endl(Ostream &os)
Add newline and flush stream.
const dimensionSet dimless
FOR_ALL_FIELD_TYPES(DefineContiguousFvWallLocationDataType)
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Vector< scalar > vector
A scalar version of the templated Vector.
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
dimensioned< scalar > mag(const dimensioned< Type > &)
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
labelList identityMap(const label len)
Create identity map (map[i] == i) of given length.
word name(const complex &)
Return a string representation of a complex.
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.