Loading...
Searching...
No Matches
MappedFile< Type > Class Template Reference

Patch value mapping from a set of values stored in a file and a set of unstructured points using the following directory structure: More...

#include <MappedFile.H>

Inheritance diagram for MappedFile< Type >:
Collaboration diagram for MappedFile< Type >:

Public Member Functions

 TypeName ("mappedFile")
 Runtime type information.
void operator= (const MappedFile< Type > &)=delete
 No copy assignment.
 MappedFile (const polyPatch &pp, const word &redirectType, const word &entryName, const dictionary &dict, const bool faceValues=true)
 Construct from entry name and dictionary.
 MappedFile (const polyPatch &pp, const word &entryName, const dictionary &dict, const word &fieldTableName, const bool faceValues=true)
 Construct from entry name and dictionary.
 MappedFile (const MappedFile< Type > &rhs, const polyPatch &pp)
 Copy construct setting patch.
 MappedFile (const MappedFile< Type > &rhs)
 Copy construct.
virtual tmp< PatchFunction1< Type > > clone () const
 Return a clone.
virtual tmp< PatchFunction1< Type > > clone (const polyPatch &pp) const
 Return a clone, setting the patch.
virtual ~MappedFile ()=default
 Destructor.
virtual bool constant () const
 Value is independent of x if there is only a single sample time.
virtual bool uniform () const
 Is value uniform (i.e. independent of coordinate).
virtual tmp< Field< Type > > value (const scalar) const
 Return MappedFile value.
virtual tmp< Field< Type > > integrate (const scalar x1, const scalar x2) const
 Integrate between two values.
virtual void autoMap (const FieldMapper &mapper)
 Map (and resize as needed) from self given a mapping object.
virtual void rmap (const PatchFunction1< Type > &pf1, const labelList &addr)
 Reverse map the given PatchFunction1 onto this PatchFunction1.
virtual void writeEntries (Ostream &os) const
 Write coefficient entries in dictionary format.
virtual void writeData (Ostream &os) const
 Write in dictionary format.
Public Member Functions inherited from PatchFunction1< Type >
 TypeName ("PatchFunction1") declareRunTimeSelectionTable(autoPtr
 Runtime type information.
 PatchFunction1 (const polyPatch &pp, const word &entryName, const bool faceValues=true)
 Construct from polyPatch and entry name.
 PatchFunction1 (const polyPatch &pp, const word &entryName, const dictionary &dict, const bool faceValues=true)
 Construct from polyPatch, dictionary and entry name.
 PatchFunction1 (const PatchFunction1< Type > &rhs, const polyPatch &pp)
 Copy construct setting patch.
 PatchFunction1 (const PatchFunction1< Type > &rhs)
 Copy construct.
virtual ~PatchFunction1 ()=default
 Destructor.
virtual bool good () const
 Can function be evaluated?
virtual tmp< pointFieldlocalPosition (const pointField &globalPos) const
 Helper: optionally convert coordinates to local coordinates.
virtual tmp< Field< Type > > transform (const Field< Type > &fld) const
 Apply optional transformation.
virtual tmp< Field< Type > > transform (const tmp< Field< Type > > &tfld) const
 Apply optional transformation.
Public Member Functions inherited from patchFunction1Base
 patchFunction1Base (const polyPatch &pp, const word &entryName, const bool faceValues=true)
 Construct from polyPatch and entry name.
 patchFunction1Base (const polyPatch &pp, const word &entryName, const dictionary &dict, const bool faceValues=true)
 Construct from polyPatch, dictionary and entry name.
 patchFunction1Base (const patchFunction1Base &rhs)
 Copy construct.
 patchFunction1Base (const patchFunction1Base &rhs, const polyPatch &pp)
 Copy construct setting patch.
virtual ~patchFunction1Base ()=default
 Destructor.
const wordname () const noexcept
 The name of the entry.
const polyPatchpatch () const noexcept
 Reference to the patch.
bool faceValues () const noexcept
 Generate face or point values on patch?
label size () const
 Number of faces or points on the patch.
const objectRegistrywhichDb () const
 Return the associated registry (ie, the mesh).
const objectRegistryobr () const
 Return the object registry (ie, the mesh).
const Timetime () const
 Return false: function not created with time database.
virtual void userTimeToTime (const Time &t)
 Convert time.
Public Member Functions inherited from refCount
constexpr refCount () noexcept
 Default construct, initializing count to 0.
int use_count () const noexcept
 Return the current reference count.
bool unique () const noexcept
 Return true if the reference count is zero.
void operator++ () noexcept
 Increment the reference count.
void operator++ (int) noexcept
 Increment the reference count.
void operator-- () noexcept
 Decrement the reference count.
void operator-- (int) noexcept
 Decrement the reference count.

Additional Inherited Members

Public Types inherited from PatchFunction1< Type >
typedef Field< Type > returnType
 The return type is a field of values.
Static Public Member Functions inherited from PatchFunction1< Type >
template<class Derived>
static tmp< PatchFunction1< Type > > Clone (const Derived &fun)
 Clone a PatchFunction1.
template<class Derived>
static tmp< PatchFunction1< Type > > Clone (const Derived &fun, const polyPatch &pp)
 Clone a PatchFunction1 with a patch.
static autoPtr< PatchFunction1< Type > > New (const polyPatch &pp, const word &entryName, const dictionary &dict, const bool faceValues=true, const bool mandatory=true)
 Selector.
static autoPtr< PatchFunction1< Type > > NewCompat (const polyPatch &pp, const word &entryName, std::initializer_list< std::pair< const char *, int > > compat, const dictionary &dict, const bool faceValues=true, const bool mandatory=true)
 Compatibility selector.
static autoPtr< PatchFunction1< Type > > NewIfPresent (const polyPatch &pp, const word &entryName, const dictionary &dict, const bool faceValues=true)
 An optional selector.
static refPtr< PatchFunction1< Type > > New (HashPtrTable< PatchFunction1< Type > > &cache, const polyPatch &pp, const word &entryName, const dictionary &dict, enum keyType::option matchOpt=keyType::LITERAL, const bool faceValues=true, const bool mandatory=true)
 Selector with external storage. This also allows wildcard matches in a dictionary.
Public Attributes inherited from PatchFunction1< Type >
 PatchFunction1
 dictionary
const polyPatchpp
const polyPatch const wordtype
const polyPatch const word const wordentryName
const polyPatch const word const word const dictionarydict
const polyPatch const word const word const dictionary const bool faceValues
const polyPatch const word const word const dictionary const bool pp
const polyPatch const word const word const dictionary const bool type
const polyPatch const word const word const dictionary const bool entryName
const polyPatch const word const word const dictionary const bool dict
Protected Member Functions inherited from PatchFunction1< Type >
void operator= (const PatchFunction1< Type > &)=delete
 No copy assignment.
Protected Member Functions inherited from patchFunction1Base
void operator= (const patchFunction1Base &)=delete
 No copy assignment.
Protected Attributes inherited from PatchFunction1< Type >
coordinateScaling< Type > coordSys_
 Optional local coordinate system and scaling.
Protected Attributes inherited from patchFunction1Base
const word name_
 Name of entry.
const polyPatchpatch_
 Reference to the patch.
const bool faceValues_
 Generate face or point values on patch.

Detailed Description

template<class Type>
class Foam::PatchFunction1Types::MappedFile< Type >

Patch value mapping from a set of values stored in a file and a set of unstructured points using the following directory structure:

    constant/boundaryData/\<patchName\>/points
    constant/boundaryData/\<patchName\>/\<time\>/\<field\>

Options:

Property Description Type Reqd Deflt
mapMethod Mapping method word no planar
offset Time-varying offset values to interpolated data Function1<Type> no -
fieldTable Name of field data table word no field-name
points Name of the points file word no points
perturb Perturbation fraction of bounding box scalar no 1e-5
setAverage Adjust mapped field to maintain average value scalar no false

Options for the mapMethod entry:

Property Description
nearest Use nearest points only (avoids triangulation)
planar Interpolation using 2D Delaunay triangulation

Options for reading and filtering:

Property Description
sampleFormat The surfaceReader format (eg, ensight)
sampleFile <case>/foo/bar/window.case
filterRadius Search radius [m] for median filter neighbours
filterSweeps Filter sweeps for median filter
readOptions Format options for surfaceReader format (eg, ensight)
Note
The MappedFile handling currently has two different reading types: a builtin boundaryData reader (default) and a surfaceReader (specified by sampleFormat and sampleFile keywords). The generic surfaceReader handling does not support field averaging.
Source files

Definition at line 170 of file MappedFile.H.

Constructor & Destructor Documentation

◆ MappedFile() [1/4]

template<class Type>
MappedFile ( const polyPatch & pp,
const word & redirectType,
const word & entryName,
const dictionary & dict,
const bool faceValues = true )

◆ MappedFile() [2/4]

template<class Type>
MappedFile ( const polyPatch & pp,
const word & entryName,
const dictionary & dict,
const word & fieldTableName,
const bool faceValues = true )

◆ MappedFile() [3/4]

template<class Type>
MappedFile ( const MappedFile< Type > & rhs,
const polyPatch & pp )
explicit

Copy construct setting patch.

Definition at line 172 of file MappedFile.C.

References clone(), PatchFunction1< Type >::PatchFunction1, PatchFunction1< Type >::pp, and Foam::rhs().

Here is the call graph for this function:

◆ MappedFile() [4/4]

template<class Type>
MappedFile ( const MappedFile< Type > & rhs)
explicit

Copy construct.

Definition at line 209 of file MappedFile.C.

References patchFunction1Base::patch(), and Foam::rhs().

Here is the call graph for this function:

◆ ~MappedFile()

template<class Type>
virtual ~MappedFile ( )
virtualdefault

Destructor.

Member Function Documentation

◆ TypeName()

template<class Type>
TypeName ( "mappedFile" )

Runtime type information.

◆ operator=()

template<class Type>
void operator= ( const MappedFile< Type > & )
delete

◆ clone() [1/2]

template<class Type>
virtual tmp< PatchFunction1< Type > > clone ( ) const
inlinevirtual

Return a clone.

Implements PatchFunction1< Type >.

Definition at line 357 of file MappedFile.H.

References PatchFunction1< Type >::Clone(), and patchFunction1Base::patch().

Referenced by MappedFile().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ clone() [2/2]

template<class Type>
virtual tmp< PatchFunction1< Type > > clone ( const polyPatch & pp) const
inlinevirtual

Return a clone, setting the patch.

Implements PatchFunction1< Type >.

Definition at line 365 of file MappedFile.H.

References PatchFunction1< Type >::Clone(), and PatchFunction1< Type >::pp.

Here is the call graph for this function:

◆ constant()

template<class Type>
virtual bool constant ( ) const
inlinevirtual

Value is independent of x if there is only a single sample time.

Reimplemented from PatchFunction1< Type >.

Definition at line 382 of file MappedFile.H.

◆ uniform()

template<class Type>
virtual bool uniform ( ) const
inlinevirtual

Is value uniform (i.e. independent of coordinate).

Implements PatchFunction1< Type >.

Definition at line 390 of file MappedFile.H.

References PatchFunction1< Type >::uniform().

Here is the call graph for this function:

◆ value()

template<class Type>
Foam::tmp< Foam::Field< Type > > value ( const scalar x) const
virtual

Return MappedFile value.

Reimplemented from PatchFunction1< Type >.

Definition at line 650 of file MappedFile.C.

References DebugInfo, Foam::endl(), fld(), Foam::gAverage(), Foam::gMinMax(), Foam::gWeightedAverage(), limits, Foam::mag(), Foam::New(), patchFunction1Base::patch_, Foam::Pout, s(), Foam::transform(), and x.

Here is the call graph for this function:

◆ integrate()

template<class Type>
Foam::tmp< Foam::Field< Type > > integrate ( const scalar x1,
const scalar x2 ) const
virtual

Integrate between two values.

Reimplemented from PatchFunction1< Type >.

Definition at line 758 of file MappedFile.C.

References NotImplemented.

◆ autoMap()

template<class Type>
void autoMap ( const FieldMapper & mapper)
virtual

Map (and resize as needed) from self given a mapping object.

Reimplemented from PatchFunction1< Type >.

Definition at line 221 of file MappedFile.C.

References PatchFunction1< Type >::autoMap().

Here is the call graph for this function:

◆ rmap()

template<class Type>
void rmap ( const PatchFunction1< Type > & pf1,
const labelList & addr )
virtual

Reverse map the given PatchFunction1 onto this PatchFunction1.

Reimplemented from PatchFunction1< Type >.

Definition at line 245 of file MappedFile.C.

References PatchFunction1< Type >::PatchFunction1, Foam::refCast(), PatchFunction1< Type >::rmap(), and patchFunction1Base::size().

Here is the call graph for this function:

◆ writeEntries()

template<class Type>
void writeEntries ( Ostream & os) const
virtual

Write coefficient entries in dictionary format.

Definition at line 770 of file MappedFile.C.

References e, name, and os().

Referenced by writeData().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeData()

template<class Type>
void writeData ( Ostream & os) const
virtual

Write in dictionary format.

Reimplemented from PatchFunction1< Type >.

Definition at line 819 of file MappedFile.C.

References Ostream::beginBlock(), name, os(), Foam::type(), PatchFunction1< Type >::writeData(), and writeEntries().

Here is the call graph for this function:

The documentation for this class was generated from the following files: