property Class Reference

property holds the pure properties of materials. More...

Inheritance diagram for property:
Collaboration diagram for property:

Public Member Functions

 TypeInfoNV ("property")
 Type info. More...
 
 property ()
 Emptry constructor, used for reading from a file. More...
 
 property (const wordVector &materials, const realVector &densities)
 Constructe from materials and densities. More...
 
 property (const fileSystem &file)
 Construct from file. More...
 
 property (const dictionary &dict)
 Construct from dictionary dict. More...
 
 property (const property &)=default
 Default copy. More...
 
 property (property &&)=default
 Default move. More...
 
propertyoperator= (const property &)=default
 Default copy assignment. More...
 
propertyoperator= (property &&)=default
 Default move assignment. More...
 
 ~property ()=default
 Default destructor. More...
 
const auto & dict () const
 Return dictionary. More...
 
auto numMaterials () const
 Return number of materials. More...
 
const auto & materials () const
 Return list of material names. More...
 
const auto & densities () const
 Return the list of densities. More...
 
const wordmaterial (uint32 i) const
 Return the material name of material i. More...
 
bool material (uint32 i, word &name) const
 Get the name of material i. More...
 
real density (uint32 i) const
 Return density of material i. More...
 
bool density (uint32 i, real &rho) const
 Get the density of material i. More...
 
bool nameToIndex (const word &name, uint32 &idx) const
 Get the name of material in index idx Return true, if the name found, otherwise false. More...
 
bool read (const dictionary &dict)
 Read from dictionary. More...
 
bool write (dictionary &dict) const
 Write to dictionary. More...
 

Protected Member Functions

bool readDictionary (const dictionary &dict)
 read from dict More...
 
bool writeDictionary (dictionary &dict) const
 write to dict More...
 
bool makeNameIndex ()
 creates a mapp More...
 

Protected Attributes

uniquePtr< dictionarydict_ = nullptr
 pointer to the dictionary, if it is constructed from a file/dictionary More...
 
wordVector materials_
 list of name of materials More...
 
realVector densities_
 list of density of materials More...
 
wordHashMap< uint32nameIndex_
 rapid mapping from name to index More...
 
uint32 numMaterials_ = 0
 number of materials More...
 

Detailed Description

property holds the pure properties of materials.

This class holds a list of all materials name and their densities that are used in the simulation: for walls and particles.

Definition at line 40 of file property.hpp.

Constructor & Destructor Documentation

◆ property() [1/6]

property ( )
inline

Emptry constructor, used for reading from a file.

Definition at line 82 of file property.hpp.

◆ property() [2/6]

property ( const wordVector materials,
const realVector densities 
)

Constructe from materials and densities.

Definition at line 97 of file property.cpp.

References fatalErrorInFunction, and fatalExit.

◆ property() [3/6]

property ( const fileSystem file)

Construct from file.

Definition at line 114 of file property.cpp.

References fatalExit, ioErrorInFile, IOstream::lineNumber(), and Istream::name().

Here is the call graph for this function:

◆ property() [4/6]

property ( const dictionary dict)

Construct from dictionary dict.

Definition at line 140 of file property.cpp.

References fatalExit.

◆ property() [5/6]

property ( const property )
default

Default copy.

◆ property() [6/6]

property ( property &&  )
default

Default move.

◆ ~property()

~property ( )
default

Default destructor.

Member Function Documentation

◆ readDictionary()

bool readDictionary ( const dictionary dict)
protected

read from dict

Definition at line 26 of file property.cpp.

References pFlow::endl(), fatalErrorInFunction, dictionary::getVal(), dictionary::globalName(), and Vector< T, Allocator >::size().

Referenced by property::read().

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

◆ writeDictionary()

bool writeDictionary ( dictionary dict) const
protected

write to dict

Definition at line 54 of file property.cpp.

References dictionary::add(), pFlow::endl(), fatalErrorInFunction, and dictionary::globalName().

Referenced by property::write().

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

◆ makeNameIndex()

bool makeNameIndex ( )
protected

creates a mapp

Definition at line 76 of file property.cpp.

References fatalErrorInFunction, property::materials_, property::nameIndex_, property::numMaterials_, and Vector< T, Allocator >::size().

Here is the call graph for this function:

◆ TypeInfoNV()

TypeInfoNV ( "property"  )

Type info.

◆ operator=() [1/2]

property& operator= ( const property )
default

Default copy assignment.

◆ operator=() [2/2]

property& operator= ( property &&  )
default

Default move assignment.

◆ dict()

const auto& dict ( ) const
inline

Return dictionary.

Definition at line 112 of file property.hpp.

References property::dict_.

Referenced by property::read(), and property::write().

Here is the caller graph for this function:

◆ numMaterials()

auto numMaterials ( ) const
inline

Return number of materials.

Definition at line 118 of file property.hpp.

References property::numMaterials_.

◆ materials()

const auto& materials ( ) const
inline

Return list of material names.

Definition at line 124 of file property.hpp.

References property::materials_.

◆ densities()

const auto& densities ( ) const
inline

Return the list of densities.

Definition at line 129 of file property.hpp.

References property::densities_.

◆ material() [1/2]

const word& material ( uint32  i) const
inline

Return the material name of material i.

Definition at line 134 of file property.hpp.

References property::materials_.

Referenced by property::material().

Here is the caller graph for this function:

◆ material() [2/2]

bool material ( uint32  i,
word name 
) const
inline

Get the name of material i.

Return true, if i is in the range and otherwise false

Definition at line 141 of file property.hpp.

References property::material(), and property::numMaterials_.

Here is the call graph for this function:

◆ density() [1/2]

real density ( uint32  i) const
inline

Return density of material i.

Definition at line 156 of file property.hpp.

References property::densities_.

Referenced by property::density().

Here is the caller graph for this function:

◆ density() [2/2]

bool density ( uint32  i,
real rho 
) const
inline

Get the density of material i.

Return true, if i is in the range and otherwise false

Definition at line 163 of file property.hpp.

References property::density(), and property::numMaterials_.

Here is the call graph for this function:

◆ nameToIndex()

bool nameToIndex ( const word name,
uint32 idx 
) const
inline

Get the name of material in index idx Return true, if the name found, otherwise false.

Definition at line 179 of file property.hpp.

References property::nameIndex_.

Referenced by geometry::findPropertyId().

Here is the caller graph for this function:

◆ read()

bool read ( const dictionary dict)
inline

Read from dictionary.

Definition at line 196 of file property.hpp.

References property::dict(), and property::readDictionary().

Here is the call graph for this function:

◆ write()

bool write ( dictionary dict) const
inline

Write to dictionary.

Definition at line 202 of file property.hpp.

References property::dict(), and property::writeDictionary().

Here is the call graph for this function:

Member Data Documentation

◆ dict_

uniquePtr<dictionary> dict_ = nullptr
protected

pointer to the dictionary, if it is constructed from a file/dictionary

Definition at line 47 of file property.hpp.

Referenced by property::dict().

◆ materials_

wordVector materials_
protected

list of name of materials

Definition at line 50 of file property.hpp.

Referenced by property::makeNameIndex(), property::material(), and property::materials().

◆ densities_

realVector densities_
protected

list of density of materials

Definition at line 53 of file property.hpp.

Referenced by property::densities(), and property::density().

◆ nameIndex_

wordHashMap<uint32> nameIndex_
protected

rapid mapping from name to index

Definition at line 56 of file property.hpp.

Referenced by property::makeNameIndex(), and property::nameToIndex().

◆ numMaterials_

uint32 numMaterials_ = 0
protected

number of materials

Definition at line 59 of file property.hpp.

Referenced by property::density(), property::makeNameIndex(), property::material(), and property::numMaterials().


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