40 namespace functionObjects
55 Foam::fileName Foam::functionObjects::cutLayerAverage::outputPath()
const
66 void Foam::functionObjects::cutLayerAverage::calcWeights()
71 tmp<pointScalarField> tdistance =
73 ? tmp<pointScalarField>(
nullptr)
83 tmp<scalarField> tpointXs =
86 : tmp<scalarField>(tdistance().primitiveField());
98 interpolate_ ? nLayers_ : nLayers_ + 1,
127 const SubField<scalar> distance0s(cutXs, nLayers_);
128 const SubField<scalar> distance1s(cutXs, nLayers_, 1);
129 layerDistances_.reset(((distance0s + distance1s)/2).ptr());
130 layerThicknesses_.reset((distance1s - distance0s).ptr());
134 layerPositions_.reset
136 cutPlot::applyWeights<vector>
164 void Foam::functionObjects::cutLayerAverage::clear()
167 layerDistances_.clear();
168 layerThicknesses_.clear();
169 layerPositions_.clear();
201 const bool haveDirection =
dict.found(
"direction");
202 const bool haveDistance =
dict.found(
"distance");
203 if (haveDirection == haveDistance)
206 <<
"keywords direction and distance both "
207 << (haveDirection ?
"" :
"un") <<
"defined in "
208 <<
"dictionary " <<
dict.name()
211 else if (haveDirection)
216 else if (haveDistance)
219 distanceName_ =
dict.lookup<
word>(
"distance");
222 nLayers_ =
dict.lookup<
label>(
"nPoints");
224 interpolate_ =
dict.lookupOrDefault<
bool>(
"interpolate",
false);
240 nOptimiseIter_ =
dict.lookupOrDefault(
"nOptimiseIter", 2);
254 result.
append(distanceName_);
271 if (!weights_.valid())
276 const bool writeThickness =
304 cannotFindObject(fields_[fieldi]);
309 #define DeclareTypeFieldValues(Type, nullArg) \
310 PtrList<Field<Type>> Type##FieldValues(fieldNames.size());
312 #undef DeclareTypeFieldValues
315 scalarFieldValues.set(0,
new scalarField(layerThicknesses_));
319 #define CollapseTypeFields(Type, GeoField) \
320 if (mesh_.foundObject<GeoField<Type>>(fieldNames[fieldi])) \
322 const GeoField<Type>& field = \
323 mesh_.lookupObject<GeoField<Type>>(fieldNames[fieldi]); \
325 Type##FieldValues.set \
328 cutPlot::applyWeights<Type>(nLayers_, weights_, field) \
333 #undef CollapseTypeFields
383 if (&map.
mesh() == &mesh_)
385 zone_.topoChange(map);
396 if (&map.
mesh() == &mesh_)
409 if (&map.
mesh() == &mesh_)
411 zone_.distribute(map);
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.
void append(const T &)
Append an element at the end of the list.
void size(const label)
Override size to be inconsistent with allocated storage.
fileName globalPath() const
Return the global path.
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 keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
const word & name() const
Return const reference to name.
A class for handling file names.
Abstract base-class for Time/database functionObjects.
const Time & time_
Reference to time.
const word & name() const
Return the name of this functionObject.
This function object writes graphs of cell values, volume-averaged in planes perpendicular to a given...
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.
cutLayerAverage(const word &name, const Time &runTime, const dictionary &dict)
Construct from Time and dictionary.
virtual bool execute()
Execute, currently does nothing.
virtual bool write()
Write the cutLayerAverage.
virtual ~cutLayerAverage()
Destructor.
virtual bool read(const dictionary &)
Read the cutLayerAverage data.
Specialisation of Foam::functionObject for an Foam::fvMesh, providing a reference to the Foam::fvMesh...
const fvMesh & mesh_
Reference to the fvMesh.
static const word outputPrefix
Directory prefix.
const word & name() const
Return reference to name.
Motion of the mesh specified as a list of pointMeshMovers.
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.
static word defaultRegion
Return the default region name.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
const polyMesh & mesh() const
Return polyMesh.
static autoPtr< setWriter > New(const word &writeType, const IOstream::streamFormat writeFormat=IOstream::ASCII, const IOstream::compressionType writeCompression=IOstream::UNCOMPRESSED)
Select given write options.
Template function which returns the un-mangled name of a given type. Useful for types which do not ha...
A class for handling words, derived from string.
static const word null
An empty word.
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
#define TypeFieldValuesParameter(Type, nullArg)
#define CollapseTypeFields(Type, GeoField)
#define FoundTypeField(Type, nullArg)
#define DeclareTypeFieldValues(Type, nullArg)
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
static List< word > fieldNames
List< weight > calcWeights(const polyMesh &mesh, const generatedCellZone &zone, const scalarField &pointXs, const scalarField &cellMinXs, const scalarField &cellMaxXs, const labelList &cellMinOrder, const scalarField &cutXs, const bool interpolate, const bool normalise)
void writeLayers(const fvMesh &mesh, const List< cellCutPlot::weight > &weights, const word &functionName)
Write the layers as components of a tensor field for debugging.
tmp< scalarField > calcCutXs(const polyMesh &mesh, const generatedCellZone &zone, const scalarField &pointXs, const bool interpolate, const label nCuts, const label nIter, const bool debug=false, const word &functionName=word::null, const setWriter &functionFormatter=NullObjectRef< setWriter >())
Compute and return evenly-spaced cut coordinates.
defineTypeNameAndDebug(fvMeshFunctionObject, 0)
addToRunTimeSelectionTable(functionObject, fvModel, dictionary)
static tmp< SurfaceField< Type > > interpolate(const VolField< Type > &tvf, const surfaceScalarField &faceFlux, Istream &schemeData)
Interpolate field onto faces using scheme given by Istream.
errorManipArg< error, int > exit(error &err, const int errNo=1)
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 mkDir(const fileName &, mode_t=0777)
Make a directory and return an error if it could not be created.
FOR_ALL_FIELD_TYPES(makeDimensionedPointFieldFunctions)
vectorField pointField
pointField is a vectorField.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
PointField< scalar > pointScalarField
VolField< scalar > volScalarField
dimensionSet normalised(const dimensionSet &)
typename VolField< Type >::Internal VolInternalField
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
labelList identityMap(const label len)
Create identity map (map[i] == i) of given length.
tmp< DimensionedField< TypeR, GeoMesh, Field > > New(const tmp< DimensionedField< TypeR, GeoMesh, Field >> &tdf1, const word &name, const dimensionSet &dimensions)