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::Particle ( )

default constructor

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

same as define()

virtual Particle::~Particle ( )
virtual

default

Member Function Documentation

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

for non-default constructor

void Particle::setMass ( const Real  a_mass)

set particle mass

Real& Particle::mass ( )
const Real& Particle::mass ( ) const
void Particle::setVelocity ( const RealVect a_velocity)

set velocity field

void Particle::setVelocity ( const Real a_velocity,
const int  a_dir 
)
RealVect& Particle::velocity ( )
const RealVect& Particle::velocity ( ) const
Real Particle::velocity ( const int  a_dir) const
void Particle::setAcceleration ( const RealVect a_velocity)

set acceleration field

RealVect& Particle::acceleration ( )
const RealVect& Particle::acceleration ( ) const
Real Particle::acceleration ( const int  a_dir) const
virtual bool Particle::operator== ( const Particle a_p) const
virtual
virtual bool Particle::operator== ( const Particle a_p) const
virtual
virtual bool Particle::operator!= ( const Particle a_p) const
virtual
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.

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.

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

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

Member Data Documentation

Real Particle::m_mass
protected
RealVect Particle::m_velocity
protected
RealVect Particle::m_acceleration
protected

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