Chombo + EB + MF  3.2
Public Member Functions | Protected Attributes | Friends | List of all members
BinItem Class Reference

Virtual base class for particle data. More...

#include <BinItem.H>

Inheritance diagram for BinItem:
Inheritance graph
[legend]

Public Member Functions

 BinItem ()
 Null constructor, copy constructor and operator= can be compiler defined. More...
 
 BinItem (const RealVect &a_position)
 Constructs a BinItem at a_position. More...
 
virtual ~BinItem ()
 Destructor. More...
 
virtual void define (const RealVect &a_position)
 Same as the constructor. More...
 
void setPosition (const RealVect &a_position)
 Change the position. More...
 
void setPosition (const Real a_position, const int a_dimension)
 Change one component of the position. More...
 
RealVectposition ()
 Return a reference to the position. More...
 
const RealVectposition () const
 Return a constant reference to the position. More...
 
Real position (const int a_dir) const
 Gets one component of the position. More...
 
virtual bool operator== (const BinItem &a_p) const
 Equality operator. Checks whether two BinItems have equal data. More...
 
virtual bool operator== (const BinItem *a_p) const
 Same as the above, but defined for a pointer. More...
 
virtual bool operator!= (const BinItem &a_p) const
 Inequality operator. More...
 
virtual int size () const
 Number of bytes used by linearIn()/linearOut() More...
 
virtual void linearOut (void *a_buf) const
 Write a serialized (packed) representation into a_buf. More...
 
virtual void linearIn (void *a_buf)
 Extract a serialized (packed) representation from a_buf. More...
 
int preAllocatable ()
 
virtual void print () const
 Write a human-readable version to stdout (for debugging) More...
 

Protected Attributes

RealVect m_position
 this is the position in space of this item More...
 

Friends

std::ostream & operator<< (std::ostream &ostr, const BinItem &a_item)
 

Detailed Description

Virtual base class for particle data.

BinItem is a base class to provide the necessary interface with BinFab for particle-in-bin/cell problems. Since the only attribute of a particle needed by the BinFab is position, it is the only attribute present in this class. All other attributes (charge, velocity, etc) must appear in a derived class.

Constructor & Destructor Documentation

◆ BinItem() [1/2]

BinItem::BinItem ( )

Null constructor, copy constructor and operator= can be compiler defined.

◆ BinItem() [2/2]

BinItem::BinItem ( const RealVect a_position)

Constructs a BinItem at a_position.

◆ ~BinItem()

virtual BinItem::~BinItem ( )
virtual

Destructor.

Member Function Documentation

◆ define()

virtual void BinItem::define ( const RealVect a_position)
virtual

Same as the constructor.

◆ setPosition() [1/2]

void BinItem::setPosition ( const RealVect a_position)

Change the position.

◆ setPosition() [2/2]

void BinItem::setPosition ( const Real  a_position,
const int  a_dimension 
)

Change one component of the position.

◆ position() [1/3]

RealVect& BinItem::position ( )

Return a reference to the position.

◆ position() [2/3]

const RealVect& BinItem::position ( ) const

Return a constant reference to the position.

◆ position() [3/3]

Real BinItem::position ( const int  a_dir) const

Gets one component of the position.

◆ operator==() [1/2]

virtual bool BinItem::operator== ( const BinItem a_p) const
virtual

Equality operator. Checks whether two BinItems have equal data.

◆ operator==() [2/2]

virtual bool BinItem::operator== ( const BinItem a_p) const
virtual

Same as the above, but defined for a pointer.

◆ operator!=()

virtual bool BinItem::operator!= ( const BinItem a_p) const
virtual

Inequality operator.

◆ size()

virtual int BinItem::size ( ) const
virtual

Number of bytes used by linearIn()/linearOut()

Returns the size, in number of bytes, of a flat linear representation of the data in this object.

Reimplemented in Particle.

◆ linearOut()

virtual void BinItem::linearOut ( void *  a_buf) const
virtual

Write a serialized (packed) representation into a_buf.

Write a linear representation of the internal data. Assumes that sufficient memory for the buffer has already been allocated by the caller.

Reimplemented in Particle.

◆ linearIn()

virtual void BinItem::linearIn ( void *  a_buf)
virtual

Extract a serialized (packed) representation from a_buf.

Given a linear representation of the class data previously made using linearOut() in a_buf, set the data for this class.

Reimplemented in Particle.

◆ preAllocatable()

int BinItem::preAllocatable ( )
inline

References operator<<, and print().

◆ print()

virtual void BinItem::print ( ) const
virtual

Write a human-readable version to stdout (for debugging)

Referenced by preAllocatable().

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  ostr,
const BinItem a_item 
)
friend

Referenced by preAllocatable().

Member Data Documentation

◆ m_position

RealVect BinItem::m_position
protected

this is the position in space of this item


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