graph Class Reference

Class to create, store and output qgraph files. More...

Inheritance diagram for graph:
Collaboration diagram for graph:

Classes

class  writer
 Abstract base class for a graph writer. More...
 

Public Member Functions

 graph (const string &title, const string &xName, const string &yName, const scalarField &x)
 Construct from title and labels (no curves) More...
 
 graph (const string &title, const string &xName, const string &yName, const scalarField &x, const scalarField &y)
 Construct from title, labels and y data for 1 curve. More...
 
 graph (const string &title, const string &xName, const string &yName, Istream &is)
 Construct from Istream given title and labels. More...
 
 graph (Istream &is)
 Construct from Istream. More...
 
const stringtitle () const
 
const stringxName () const
 
const stringyName () const
 
const scalarFieldx () const
 
scalarFieldx ()
 
const scalarFieldy () const
 
scalarFieldy ()
 
void writeTable (Ostream &) const
 Write out graph data as a simple table. More...
 
void write (Ostream &, const word &format) const
 Write graph to stream in given format. More...
 
void write (const fileName &pName, const word &format) const
 Write graph to file in given path-name and format. More...
 
void write (const fileName &path, const word &name, const word &format) const
 Write graph to file in given path, name and format. More...
 
- Public Member Functions inherited from HashPtrTable< curve >
 HashPtrTable (const label size=128)
 Construct given initial table size. More...
 
 HashPtrTable (Istream &, const INew &)
 Construct from Istream using given Istream constructor class. More...
 
 HashPtrTable (Istream &)
 Construct from Istream using default Istream constructor class. More...
 
 HashPtrTable (const dictionary &)
 Construct from dictionary using default dictionary constructor. More...
 
 HashPtrTable (const HashPtrTable< curve, word, string::hash > &)
 Copy constructor. More...
 
 HashPtrTable (HashPtrTable< curve, word, string::hash > &&)
 Move constructor. More...
 
 ~HashPtrTable ()
 Destructor. More...
 
curveremove (iterator &)
 Remove and return the pointer specified by given iterator. More...
 
bool erase (iterator &)
 Erase an hashedEntry specified by given iterator. More...
 
void clear ()
 Clear all entries from table. More...
 
void write (Ostream &os) const
 Write. More...
 
void operator= (const HashPtrTable< curve, word, string::hash > &)
 Assignment operator. More...
 
void operator= (HashPtrTable< curve, word, string::hash > &&)
 Move assignment operator. More...
 
- Public Member Functions inherited from HashTable< T, Key, Hash >
 HashTable (const label size=128)
 Construct given initial table size. More...
 
 HashTable (Istream &, const label size=128)
 Construct from Istream. More...
 
 HashTable (const HashTable< T, Key, Hash > &)
 Copy constructor. More...
 
 HashTable (HashTable< T, Key, Hash > &&)
 Move constructor. More...
 
 HashTable (std::initializer_list< Tuple2< Key, T >>)
 Construct from an initialiser list. More...
 
 ~HashTable ()
 Destructor. More...
 
label capacity () const
 The size of the underlying table. More...
 
label size () const
 Return number of elements in table. More...
 
bool empty () const
 Return true if the hash table is empty. More...
 
bool found (const Key &) const
 Return true if hashedEntry is found in table. More...
 
iterator find (const Key &)
 Find and return an iterator set at the hashedEntry. More...
 
const_iterator find (const Key &) const
 Find and return an const_iterator set at the hashedEntry. More...
 
List< Key > toc () const
 Return the table of contents. More...
 
List< Key > sortedToc () const
 Return the table of contents as a sorted list. More...
 
OstreamprintInfo (Ostream &) const
 Print information. More...
 
bool insert (const Key &, const T &newElmt)
 Insert a new hashedEntry. More...
 
bool set (const Key &, const T &newElmt)
 Assign a new hashedEntry, overwriting existing entries. More...
 
bool erase (const iterator &)
 Erase a hashedEntry specified by given iterator. More...
 
bool erase (const Key &)
 Erase a hashedEntry specified by the given key. More...
 
label erase (const UList< Key > &)
 Remove entries given by the listed keys from this HashTable. More...
 
template<class AnyType , class AnyHash >
label erase (const HashTable< AnyType, Key, AnyHash > &)
 Remove entries given by the given keys from this HashTable. More...
 
void resize (const label newSize)
 Resize the hash table for efficiency. More...
 
void clear ()
 Clear all entries from table. More...
 
void clearStorage ()
 Clear the table entries and the table itself. More...
 
void shrink ()
 Shrink the allocated table to approx. twice number of elements. More...
 
void transfer (HashTable< T, Key, Hash > &)
 Transfer the contents of the argument table into this table. More...
 
Toperator[] (const Key &)
 Find and return a hashedEntry. More...
 
const Toperator[] (const Key &) const
 Find and return a hashedEntry. More...
 
Toperator() (const Key &)
 Find and return a hashedEntry, create it null if not present. More...
 
void operator= (const HashTable< T, Key, Hash > &)
 Assignment operator. More...
 
void operator= (HashTable< T, Key, Hash > &&)
 Move assignment operator. More...
 
void operator= (std::initializer_list< Tuple2< Key, T >>)
 Assignment to an initialiser list. More...
 
bool operator== (const HashTable< T, Key, Hash > &) const
 Equality. Hash tables are equal if the keys and values are equal. More...
 
bool operator!= (const HashTable< T, Key, Hash > &) const
 The opposite of the equality operation. Takes linear time. More...
 
iterator begin ()
 Iterator set to the beginning of the HashTable. More...
 
const_iterator cbegin () const
 const_iterator set to the beginning of the HashTable More...
 
const_iterator begin () const
 const_iterator set to the beginning of the HashTable More...
 
template<class AnyType , class AnyHash >
Foam::label erase (const HashTable< AnyType, Key, AnyHash > &rhs)
 
- Public Member Functions inherited from HashTableCore
 HashTableCore ()
 Construct null. More...
 
 ClassName ("HashTable")
 Define template name and debug. More...
 

Static Public Member Functions

static word wordify (const string &sname)
 Helper function to convert string name into appropriate word. More...
 
- Static Public Member Functions inherited from HashTableCore
static label canonicalSize (const label)
 Return a canonical (power-of-two) size. More...
 
static iteratorEnd cend ()
 iteratorEnd set to beyond the end of any HashTable More...
 
static iteratorEnd end ()
 iteratorEnd set to beyond the end of any HashTable More...
 

Friends

Ostreamoperator<< (Ostream &, const graph &)
 Ostream Operator. More...
 

Additional Inherited Members

- Public Types inherited from HashPtrTable< curve >
typedef HashTable< curve *, word, string::hash >::iterator iterator
 
typedef HashTable< curve *, word, string::hash >::const_iterator const_iterator
 
- Public Types inherited from HashTable< T, Key, Hash >
typedef T value_type
 Type of values the HashTable contains. More...
 
typedef Treference
 Type that can be used for storing into HashTable::value_type. More...
 
typedef const Tconst_reference
 Type that can be used for storing into constant. More...
 
typedef label size_type
 The type that can represent the size of a HashTable. More...
 
- Static Public Attributes inherited from HashTableCore
static const label maxTableSize
 Maximum allowable table size. More...
 

Detailed Description

Class to create, store and output qgraph files.

Source files

Definition at line 58 of file graph.H.

Constructor & Destructor Documentation

◆ graph() [1/4]

graph ( const string title,
const string xName,
const string yName,
const scalarField x 
)

Construct from title and labels (no curves)

Definition at line 79 of file graph.C.

Referenced by graph::graph(), and graph::wordify().

Here is the caller graph for this function:

◆ graph() [2/4]

graph ( const string title,
const string xName,
const string yName,
const scalarField x,
const scalarField y 
)

Construct from title, labels and y data for 1 curve.

Definition at line 94 of file graph.C.

References curve::curveStyle::CONTINUOUS, graph::graph(), and Foam::vtkWriteOps::insert().

Here is the call graph for this function:

◆ graph() [3/4]

graph ( const string title,
const string xName,
const string yName,
Istream is 
)

Construct from Istream given title and labels.

Definition at line 112 of file graph.C.

◆ graph() [4/4]

graph ( Istream is)

Construct from Istream.

Definition at line 127 of file graph.C.

Member Function Documentation

◆ title()

const string& title ( ) const
inline

Definition at line 149 of file graph.H.

Referenced by gnuplotGraph::write(), and xmgrGraph::write().

Here is the caller graph for this function:

◆ xName()

const string& xName ( ) const
inline

Definition at line 154 of file graph.H.

Referenced by gnuplotGraph::write(), jplotGraph::write(), and xmgrGraph::write().

Here is the caller graph for this function:

◆ yName()

const string& yName ( ) const
inline

Definition at line 159 of file graph.H.

Referenced by gnuplotGraph::write(), and xmgrGraph::write().

Here is the caller graph for this function:

◆ x() [1/2]

const scalarField& x ( ) const
inline

Definition at line 165 of file graph.H.

Referenced by Foam::kShellIntegration(), noiseFFT::Ldelta(), noiseFFT::Lf(), noiseFFT::Pdelta(), gnuplotGraph::write(), and xmgrGraph::write().

Here is the caller graph for this function:

◆ x() [2/2]

scalarField& x ( )
inline

Definition at line 170 of file graph.H.

References graph::y().

Here is the call graph for this function:

◆ y() [1/2]

const Foam::scalarField & y ( ) const

Definition at line 137 of file graph.C.

References HashTable< T, Key, Hash >::begin(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, and HashTable< T, Key, Hash >::size().

Referenced by noiseFFT::Ldelta(), noiseFFT::Lf(), noiseFFT::Lsum(), noiseFFT::Pdelta(), and graph::x().

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

◆ y() [2/2]

Definition at line 150 of file graph.C.

References HashTable< T, Key, Hash >::begin(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, graph::writer::New(), and HashTable< T, Key, Hash >::size().

Here is the call graph for this function:

◆ writeTable()

void writeTable ( Ostream os) const

Write out graph data as a simple table.

Definition at line 206 of file graph.C.

References Foam::endl(), forAll, forAllConstIter(), Foam::setw(), and token::SPACE.

Referenced by Foam::operator<<(), rawGraph::write(), jplotGraph::write(), and graph::writer::~writer().

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

◆ write() [1/3]

void write ( Ostream os,
const word format 
) const

Write graph to stream in given format.

Definition at line 221 of file graph.C.

References graph::writer::New().

Referenced by Foam::makeGraph(), graph::write(), and graph::writer::~writer().

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

◆ write() [2/3]

void write ( const fileName pName,
const word format 
) const

Write graph to file in given path-name and format.

Definition at line 227 of file graph.C.

References Foam::endl(), IOstream::good(), OFstream::name(), graph::writer::New(), WarningInFunction, and graph::write().

Here is the call graph for this function:

◆ write() [3/3]

void write ( const fileName path,
const word name,
const word format 
) const

Write graph to file in given path, name and format.

Definition at line 247 of file graph.C.

References Foam::mkDir(), and graph::write().

Here is the call graph for this function:

◆ wordify()

Foam::word wordify ( const string sname)
static

Helper function to convert string name into appropriate word.

Definition at line 44 of file graph.C.

References curve::curveStyle::CONTINUOUS, forAll, graph::graph(), Foam::vtkWriteOps::insert(), string::replace(), List< T >::size(), and y.

Referenced by graph::writer::~writer().

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

Friends And Related Function Documentation

◆ operator<<

Ostream& operator<< ( Ostream ,
const graph  
)
friend

Ostream Operator.

Referenced by graph::writer::~writer().


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