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

#include <Particle.H>

Inheritance diagram for Particle:
Inheritance graph
[legend]

Public Member Functions

 Particle ()
 default constructor More...
 
 Particle (const Real a_mass, const RealVect &a_position, const RealVect &a_velocity=RealVect::Zero)
 same as define() More...
 
virtual ~Particle ()
 default More...
 
void define (const Real a_mass, const RealVect &a_position, const RealVect &a_velocity=RealVect::Zero)
 for non-default constructor More...
 
void setMass (const Real a_mass)
 set particle mass More...
 
Realmass ()
 
const Realmass () const
 
void setVelocity (const RealVect &a_velocity)
 set velocity field More...
 
void setVelocity (const Real &a_velocity, const int a_dir)
 
RealVectvelocity ()
 
const RealVectvelocity () const
 
Real velocity (const int a_dir) const
 
void setAcceleration (const RealVect &a_velocity)
 set acceleration field More...
 
RealVectacceleration ()
 
const RealVectacceleration () const
 
Real acceleration (const int a_dir) const
 
virtual bool operator== (const Particle &a_p) const
 
virtual bool operator== (const Particle *a_p) const
 
virtual bool operator!= (const Particle &a_p) const
 
virtual int size () const
 { linearization functions} More...
 
virtual void linearOut (void *buf) const
 
virtual void linearIn (void *buf)
 
- Public Member Functions inherited from BinItem
 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...
 
int preAllocatable ()
 
virtual void print () const
 Write a human-readable version to stdout (for debugging) More...
 

Protected Attributes

Real m_mass
 
RealVect m_velocity
 
RealVect m_acceleration
 
- Protected Attributes inherited from BinItem
RealVect m_position
 this is the position in space of this item More...
 

Friends

std::ostream & operator<< (std::ostream &ostr, const Particle &p)
 

Detailed Description

A basic particle class. Includes mass, position, velocity, and acceleration

Constructor & Destructor Documentation

◆ Particle() [1/2]

Particle::Particle ( )

default constructor

◆ Particle() [2/2]

Particle::Particle ( const Real  a_mass,
const RealVect a_position,
const RealVect a_velocity = RealVect::Zero 
)

same as define()

◆ ~Particle()

virtual Particle::~Particle ( )
virtual

default

Member Function Documentation

◆ define()

void Particle::define ( const Real  a_mass,
const RealVect a_position,
const RealVect a_velocity = RealVect::Zero 
)

for non-default constructor

◆ setMass()

void Particle::setMass ( const Real  a_mass)

set particle mass

◆ mass() [1/2]

Real& Particle::mass ( )

◆ mass() [2/2]

const Real& Particle::mass ( ) const

◆ setVelocity() [1/2]

void Particle::setVelocity ( const RealVect a_velocity)

set velocity field

◆ setVelocity() [2/2]

void Particle::setVelocity ( const Real a_velocity,
const int  a_dir 
)

◆ velocity() [1/3]

RealVect& Particle::velocity ( )

◆ velocity() [2/3]

const RealVect& Particle::velocity ( ) const

◆ velocity() [3/3]

Real Particle::velocity ( const int  a_dir) const

◆ setAcceleration()

void Particle::setAcceleration ( const RealVect a_velocity)

set acceleration field

◆ acceleration() [1/3]

RealVect& Particle::acceleration ( )

◆ acceleration() [2/3]

const RealVect& Particle::acceleration ( ) const

◆ acceleration() [3/3]

Real Particle::acceleration ( const int  a_dir) const

◆ operator==() [1/2]

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

◆ operator==() [2/2]

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

◆ operator!=()

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

◆ size()

virtual int Particle::size ( ) const
virtual

{ linearization functions}

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

Reimplemented from BinItem.

◆ linearOut()

virtual void Particle::linearOut ( void *  buf) const
virtual

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

Reimplemented from BinItem.

◆ linearIn()

virtual void Particle::linearIn ( void *  buf)
virtual

Read a linear binary representation of the internal data. Assumes that the buffer has the correct data.

Reimplemented from BinItem.

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  ostr,
const Particle p 
)
friend

Member Data Documentation

◆ m_mass

Real Particle::m_mass
protected

◆ m_velocity

RealVect Particle::m_velocity
protected

◆ m_acceleration

RealVect Particle::m_acceleration
protected

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