Loading...
Searching...
No Matches
pairPotentialList Class Reference

#include <pairPotentialList.H>

Inheritance diagram for pairPotentialList:
Collaboration diagram for pairPotentialList:

Public Member Functions

 pairPotentialList ()
 pairPotentialList (const List< word > &idList, const dictionary &pairPotentialDict, const polyMesh &mesh)
 Construct from idList and potential dictionaries.
 ~pairPotentialList ()
 Destructor.
void buildPotentials (const List< word > &idList, const dictionary &pairPotentialDict, const polyMesh &mesh)
scalar rCutMax () const
scalar rCutMaxSqr () const
bool rCutMaxSqr (scalar rIJMagSqr) const
const pairPotentialpairPotentialFunction (const label a, const label b) const
bool rCutSqr (const label a, const label b, const scalar rIJMagSqr) const
scalar rMin (const label a, const label b) const
scalar dr (const label a, const label b) const
scalar rCutSqr (const label a, const label b) const
scalar rCut (const label a, const label b) const
scalar force (const label a, const label b, const scalar rIJMag) const
scalar energy (const label a, const label b, const scalar rIJMag) const
const pairPotentialelectrostatic () const
Public Member Functions inherited from PtrList< pairPotential >
Foam::PtrList< pairPotentialclone (Args &&... args) const
constexpr PtrList () noexcept
 Default construct.
 ~PtrList ()
 Destructor. Frees all pointers.
const pairPotentialset (const label i) const
 Return const pointer to element (can be nullptr), or nullptr for out-of-range access (ie, with bounds checking).
void clear ()
 Clear the PtrList. Delete allocated entries and set size to zero.
void free ()
 Free memory and nullify all entries. Does not change the list size.
void resize (const label newLen)
 Adjust size of PtrList.
void resize_null (const label newLen)
 Set the addressed list to the given size, deleting all existing entries. Afterwards the list contains all nullptr entries.
pairPotentialemplace_back (Args &&... args)
 Construct and append an element to the end of the list, return reference to the new list element.
void push_back (pairPotential *ptr)
 Append an element to the end of the list.
pairPotentialemplace_set (const label i, Args &&... args)
 Construct and set a new element at given position, (discard old element at that location).
pairPotentialemplace (const label i, Args &&... args)
 Same as emplace_set().
pairPotentialtry_emplace (const label i, Args &&... args)
 Like emplace_set() but will not overwrite an occupied (non-null) location.
autoPtr< pairPotentialrelease (const label i)
 Release ownership of the pointer at the given position.
void transfer (PtrList< pairPotential > &list)
 Transfer into this list and annul the argument list.
void operator= (const UPtrList< pairPotential > &list)
 Copy assignment.
void setSize (const label n)
 Same as resize().
void append (autoPtr< pairPotential > &ptr)
 Move append an element to the end of the list.
Public Member Functions inherited from UPtrList< pairPotential >
bool empty () const noexcept
 True if the list is empty (ie, size() is zero).
label size () const noexcept
 The number of entries in the list.
label capacity () const noexcept
 Size of the underlying storage.
label count_nonnull () const noexcept
 The number of non-nullptr entries in the list.
pairPotentialfront ()
 Reference to the first element of the list.
pairPotentialback ()
 Reference to the last element of the list.
const pairPotentialtest (const label i) const
 Return const pointer to element (can be nullptr), or nullptr for out-of-range access (ie, with bounds checking).
const pairPotentialget (const label i) const
 Return const pointer to element (can be nullptr), or nullptr for out-of-range access (ie, with bounds checking).
const pairPotentialset (const label i) const
 Return const pointer to element (can be nullptr), or nullptr for out-of-range access (ie, with bounds checking).
void clear ()
 Set list size to zero.
void free ()
 Nullify all entries. Does not change the list size.
void resize (const label newLen)
 Change the size of the list. Any new entries are nullptr.
void resize_null (const label newLen)
 Set the list to the given size and set all entries to nullptr.
label squeezeNull ()
 Squeeze out nullptr entries in the list of pointers after which any null pointers will be at the end of the list.
void push_back (pairPotential *ptr)
 Append an element to the end of the list.
void swap (UPtrList< pairPotential > &list) noexcept
 Swap content.
void transfer (UPtrList< pairPotential > &list)
 Transfer contents into this list and annul the argument.
void reorder (const labelUList &oldToNew, const bool check=false)
 Reorder elements. Reordering must be unique (ie, shuffle).
void sortOrder (const labelUList &order, const bool check=false)
 Reorder elements according to new order mapping (newToOld). Reordering must be unique (ie, shuffle).
void checkNonNull () const
 Check and raise FatalError if any nullptr exists in the list.
const pairPotentialat (const label i) const
 Return const reference to the element at given position. FatalError for bounds problem or nullptr.
const pairPotentialoperator[] (const label i) const
 Return const reference to the element at given position. FatalError for bounds problem or nullptr. Same as at().
 FOAM_DEPRECATED_FOR (2022-09, "get(), set() or test() methods") const pairPotential *operator()(const label i) const
 Deprecated(2022-09) - same as get().
void operator= (const UPtrList< pairPotential > &list)
 Copy assignment (shallow copies addresses).
OstreamprintAddresses (Ostream &os) const
 Print pointer addresses to Ostream (debugging only).
OstreamwriteList (Ostream &os, const bool trimNull=false) const
 Write UPtrList to Ostream, optionally ignoring null entries.
pairPotential ** begin_ptr () noexcept
 Iterator to begin of raw pointers traversal (use with caution).
pairPotential ** end_ptr () noexcept
 Iterator beyond end of raw pointers traversal (use with caution).
iterator begin ()
 Return iterator to begin traversal of non-nullptr entries.
iterator end () noexcept
 Return iterator beyond end of UPtrList traversal.
const_iterator cbegin () const
 Return const_iterator to begin traversal of non-nullptr entries.
const_iterator cend () const noexcept
 Return const_iterator beyond end of UPtrList traversal.
void setSize (const label n)
 Alias for resize().
pairPotentialfirst ()
 Reference to the first element of the list.
pairPotentiallast ()
 Return reference to the last element of the list.
void append (pairPotential *ptr)
 Append an element to the end of the list.
label count () const noexcept
 The number of non-nullptr entries in the list.

Additional Inherited Members

Public Types inherited from UPtrList< pairPotential >
typedef pairPotential value_type
 Type of values the list contains.
typedef pairPotentialreference
 A non-const reference to the value_type.
typedef const pairPotentialconst_reference
 A const reference to the value_type.
Protected Member Functions inherited from PtrList< pairPotential >
void readIstream (Istream &is, const INew &inew)
 Read from Istream using Istream constructor class.
Protected Member Functions inherited from UPtrList< pairPotential >
void setAddressableSize (const label n) noexcept
 Adjust addressable size.
label find_next (label pos) const
 The next non-null entry after the specified position.
 UPtrList (Detail::PtrListDetail< pairPotential > &&ptrs) noexcept
 Low-level move construct.
Protected Attributes inherited from UPtrList< pairPotential >
Detail::PtrListDetail< pairPotentialptrs_
 The list of pointers.

Detailed Description

Constructor & Destructor Documentation

◆ pairPotentialList() [1/2]

pairPotentialList ( )

Definition at line 185 of file pairPotentialList.C.

References PtrList< pairPotential >::PtrList().

Here is the call graph for this function:

◆ pairPotentialList() [2/2]

pairPotentialList ( const List< word > & idList,
const dictionary & pairPotentialDict,
const polyMesh & mesh )

Construct from idList and potential dictionaries.

Definition at line 191 of file pairPotentialList.C.

References buildPotentials(), mesh, and PtrList< pairPotential >::PtrList().

Here is the call graph for this function:

◆ ~pairPotentialList()

~pairPotentialList ( )

Destructor.

Definition at line 206 of file pairPotentialList.C.

Member Function Documentation

◆ buildPotentials()

void buildPotentials ( const List< word > & idList,
const dictionary & pairPotentialDict,
const polyMesh & mesh )

Definition at line 212 of file pairPotentialList.C.

References mesh, setSize(), and UList< T >::size().

Referenced by pairPotentialList().

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

◆ rCutMax()

Foam::scalar rCutMax ( ) const
inline

Definition at line 55 of file pairPotentialListI.H.

◆ rCutMaxSqr() [1/2]

Foam::scalar rCutMaxSqr ( ) const
inline

Definition at line 61 of file pairPotentialListI.H.

◆ rCutMaxSqr() [2/2]

bool rCutMaxSqr ( scalar rIJMagSqr) const

Definition at line 237 of file pairPotentialList.C.

◆ pairPotentialFunction()

const Foam::pairPotential & pairPotentialFunction ( const label a,
const label b ) const

Definition at line 227 of file pairPotentialList.C.

References b.

◆ rCutSqr() [1/2]

bool rCutSqr ( const label a,
const label b,
const scalar rIJMagSqr ) const

Definition at line 248 of file pairPotentialList.C.

References b, and rCutSqr().

Referenced by rCutSqr().

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

◆ rMin()

Foam::scalar rMin ( const label a,
const label b ) const

Definition at line 264 of file pairPotentialList.C.

References b.

◆ dr()

Foam::scalar dr ( const label a,
const label b ) const

Definition at line 274 of file pairPotentialList.C.

References b.

◆ rCutSqr() [2/2]

Foam::scalar rCutSqr ( const label a,
const label b ) const

Definition at line 284 of file pairPotentialList.C.

References b.

◆ rCut()

Foam::scalar rCut ( const label a,
const label b ) const

Definition at line 294 of file pairPotentialList.C.

References b.

◆ force()

Foam::scalar force ( const label a,
const label b,
const scalar rIJMag ) const

Definition at line 304 of file pairPotentialList.C.

References b, and f().

Here is the call graph for this function:

◆ energy()

Foam::scalar energy ( const label a,
const label b,
const scalar rIJMag ) const

Definition at line 317 of file pairPotentialList.C.

References b, and e.

◆ electrostatic()

const Foam::pairPotential & electrostatic ( ) const
inline

Definition at line 67 of file pairPotentialListI.H.


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