53 int main(
int argc,
char *argv[])
57 "Testing, pre-processing, filtering of surface field data" 71 "Field <scalar> to process (default: T)" 78 "Input format (default: ensight)" 86 const word readFileType
92 label filterSweeps_(1);
93 scalar filterRadius_(0);
98 <<
"Filter: radius=" << filterRadius_
99 <<
" sweeps=" << filterSweeps_ <<
endl;
102 if ((filterSweeps_ < 1) || (filterRadius_ <= VSMALL))
116 auto& reader = readerPtr_();
118 const label fieldIndex = reader.fieldNames(0).find(fieldName);
119 if (fieldIndex == -1)
122 <<
"Unable to find field name: " << fieldName
123 <<
" in list of available fields: " << reader.fieldNames(0)
132 << geom.
nPoints() <<
" points in " 139 fieldFilter.
reset(geom, filterRadius_);
141 Info<<
nl <<
"Built weights/addressing " 144 Info<<
nl <<
"Processing " << reader.times().size() <<
" times" <<
nl;
155 tfield = fieldFilter.
evaluate(tfield, filterSweeps_);
171 Info<<
nl <<
"Smoothing/writing "
label nPoints() const
Number of points supporting patch faces.
static void addNote(const string ¬e)
Add extra notes for the usage information.
A class for handling file names.
errorManipArg< error, int > exit(error &err, const int errNo=1)
vtk::lineWriter writer(edgeCentres, edgeList::null(), fileName(aMesh.time().globalPath()/"finiteArea-edgesCentres"))
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
void piece(const pointField &points, const edgeList &edges)
Reset point/edge references to begin a new piece.
constexpr char nl
The newline '\n' character (0x0a)
Write faces/points (optionally with fields) as a vtp file or a legacy vtk file.
Ostream & endl(Ostream &os)
Add newline and flush stream.
A traits class, which is primarily used for primitives and vector-space.
T getOrDefault(const word &optName, const T &deflt) const
Get a value from the named option if present, or return default.
#define forAll(list, i)
Loop across all elements in list.
void writeCellData(const word &fieldName, const UList< Type > &field)
Write primitive field of CellData.
The FilterField helper class provides a multi-sweep median filter for a Field of data associated with...
A class for handling words, derived from Foam::string.
Extract command arguments and options from the supplied argc and argv parameters. ...
static void addOption(const word &optName, const string ¶m="", const string &usage="", bool advanced=false)
Add an option to validOptions with usage information.
const Field< point_type > & points() const noexcept
Return reference to global points.
static void noCheckProcessorDirectories()
Disable checking of processor directories.
static word printf(const char *fmt, const PrimitiveType &val)
Use a printf-style formatter for a primitive.
void reset()
Reset to unweighted (pass-through)
virtual bool beginCellData(label nFields=0)
Begin CellData output section for specified number of fields.
static void addVerboseOption(const string &usage="", bool advanced=false)
Enable a 'verbose' bool option, with usage information.
int debug
Static debugging option.
tmp< Field< Type > > evaluate(const tmp< Field< Type >> &tinput, const label nSweeps) const
Return the median smoothed field.
Specialisations of Field<T> for scalar, vector and tensor.
static autoPtr< surfaceReader > New(const word &readType, const fileName &fName, const dictionary &options=dictionary())
Return a reference to the selected surfaceReader.
T get(const label index) const
Get a value from the argument at index.
static void addArgument(const string &argName, const string &usage="")
Append a (mandatory) argument to validArgs.
double timeIncrement() const
The time [seconds] since the last call to timeIncrement()
messageStream Info
Information stream (stdout output on master, null elsewhere)
virtual bool writeGeometry()
Write patch topology.
bool readIfPresent(const word &optName, T &val) const
Read a value from the named option if present.
A class for managing temporary objects.
Foam::argList args(argc, argv)
label nFaces() const noexcept
Number of faces in the patch.
int verbose() const noexcept
Return the verbose flag.
Starts timing and returns elapsed time from start. Uses std::chrono::high_resolution_clock for better...