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...

Inheritance diagram for MappedFile< Type >:
[legend]
Collaboration diagram for MappedFile< Type >:
[legend]

Public Member Functions

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

Additional Inherited Members

- Public Types inherited from PatchFunction1< Type >
typedef Field< Type > returnType
 
- Static Public Member Functions inherited from PatchFunction1< Type >
static autoPtr< PatchFunction1< Type > > New (const polyPatch &pp, const word &entryName, const dictionary &dict, const bool faceValues=true, const bool mandatory=true)
 Selector. More...
 
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. More...
 
static autoPtr< PatchFunction1< Type > > NewIfPresent (const polyPatch &pp, const word &entryName, const dictionary &dict, const bool faceValues=true)
 An optional selector. More...
 
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)
 
- 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. More...
 
- Protected Member Functions inherited from patchFunction1Base
void operator= (const patchFunction1Base &)=delete
 No copy assignment. More...
 
- Protected Attributes inherited from PatchFunction1< Type >
coordinateScaling< Type > coordSys_
 Optional local coordinate system and scaling. More...
 
- Protected Attributes inherited from patchFunction1Base
const word name_
 Name of entry. More...
 
const polyPatchpatch_
 Reference to the patch. More...
 
const bool faceValues_
 Generate face or point values on patch. More...
 

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

planarInterpolation
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:

      nearest               | Use nearest points only (avoids triangulation)
      planarInterpolation   | Interpolation using 2D Delaunay triangulation
Source files

Definition at line 129 of file MappedFile.H.

Constructor & Destructor Documentation

◆ MappedFile() [1/4]

MappedFile ( const polyPatch pp,
const word redirectType,
const word entryName,
const dictionary dict,
const bool  faceValues = true 
)

Construct from entry name and dictionary.

Definition at line 34 of file MappedFile.C.

References PatchFunction1< Type >::dict, Foam::exit(), Foam::FatalIOError, and FatalIOErrorInFunction.

Here is the call graph for this function:

◆ MappedFile() [2/4]

MappedFile ( const polyPatch pp,
const word entryName,
const dictionary dict,
const word fieldTableName,
const bool  faceValues 
)

Construct from entry name and dictionary.

Definition at line 81 of file MappedFile.C.

References PatchFunction1< Type >::dict, Foam::exit(), Foam::FatalIOError, and FatalIOErrorInFunction.

Here is the call graph for this function:

◆ MappedFile() [3/4]

MappedFile ( const MappedFile< Type > &  rhs)
explicit

Copy construct.

Definition at line 128 of file MappedFile.C.

◆ MappedFile() [4/4]

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

Copy construct setting patch.

Definition at line 138 of file MappedFile.C.

◆ ~MappedFile()

virtual ~MappedFile ( )
virtualdefault

Destructor.

Member Function Documentation

◆ TypeName()

TypeName ( "mappedFile"  )

Runtime type information.

◆ operator=()

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

No copy assignment.

◆ clone() [1/2]

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

Construct and return a clone.

Implements PatchFunction1< Type >.

Definition at line 230 of file MappedFile.H.

◆ clone() [2/2]

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

Construct and return a clone setting patch.

Implements PatchFunction1< Type >.

Definition at line 239 of file MappedFile.H.

References PatchFunction1< Type >::pp.

◆ constant()

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 255 of file MappedFile.H.

References UList< T >::size().

Here is the call graph for this function:

◆ uniform()

virtual bool uniform ( ) const
inlinevirtual

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

Implements PatchFunction1< Type >.

Definition at line 261 of file MappedFile.H.

References PatchFunction1< Type >::uniform().

Here is the call graph for this function:

◆ value()

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

Return MappedFile value.

Reimplemented from PatchFunction1< Type >.

Definition at line 480 of file MappedFile.C.

References Foam::endl(), fld(), Foam::gAverage(), Foam::gMax(), Foam::gMin(), Foam::gSum(), Foam::mag(), OSstream::name(), fileName::name(), Foam::New(), Foam::nl, Foam::Pout, s(), Foam::transform(), and x.

Here is the call graph for this function:

◆ integrate()

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 590 of file MappedFile.C.

References NotImplemented.

◆ autoMap()

void autoMap ( const FieldMapper mapper)
virtual

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

Reimplemented from PatchFunction1< Type >.

Definition at line 166 of file MappedFile.C.

References PatchFunction1< Type >::autoMap().

Here is the call graph for this function:

◆ rmap()

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 191 of file MappedFile.C.

References PatchFunction1< Type >::rmap().

Referenced by MappedFile< scalar >::MappedFile().

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

◆ writeEntries()

void writeEntries ( Ostream os) const
virtual

Write coefficient entries in dictionary format.

Definition at line 602 of file MappedFile.C.

References e, Foam::name(), and os().

Here is the call graph for this function:

◆ writeData()

void writeData ( Ostream os) const
virtual

Write in dictionary format.

Reimplemented from PatchFunction1< Type >.

Definition at line 638 of file MappedFile.C.

References Ostream::beginBlock(), Foam::name(), os(), and Foam::type().

Here is the call graph for this function:

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