Allink  v0.1
Public Member Functions | Public Attributes
DdLinkedList Class Reference

Domain decomposition as pointer to linked particles. More...

#include <Cubo.h>

Inheritance diagram for DdLinkedList:
DomDecBasics

List of all members.

Public Member Functions

 DdLinkedList (double Edge[3], int NPart, double CutOff)
 Allocate.
void Erase ()
 Erase the pairlist.
void Clear ()
 Clear the pairlist.
int SwapPart (int p1, double *Pos1, int p2, double *Pos2)
 Swap two particles.
void AddPart (const int p, double *Pos)
 Add a particle to the cell c.
void RemPart (const int p, double *Pos)
 Remove a particle form the cell c.
void RemPart (const int p)
 Remove the particle p.
void AddPart (const int p, const int c)
 Add a particle to the cell c.
void RemPart (const int p, const int c)
 Remove a particle form the cell c.
void MovePart (const int p, double *OldPos, double *NewPos)
 Move a particle form the cell c1 to the cell c2.
void MovePart (const int p, double *NewPos)
 Move a particle form the cell c1 to the cell c2.
int PosRet (const double Pos[3])
 Relative position in the cell.
int pNPart (const int c)
 # part in the cell
int pNPart ()
 # part in the class
int pCell (const int p)
 Print the cell which the particle belong.
int First (const int c)
 First part in the cell.
int Next (const int p)
 Next linked part.
int ItCell (const int c)
 Iterate in the cell.
int IfItCell (const int c)
 Stop the loop and set the counter to zero.
int IfItCouple (const int c)
 Stop the loop and set the counter to zero.
int SetCoorNumb (double *Pos, int p)
 Set the coordination umber to the part p.
int GetNei (double *Pos, int *NeiList)
 Choose among the different neighbouring lists.
void SetCounters (int c)
 Set the counters to the initial position.
void Couple (const int c, int *p1, int *p2)
 Iterates along all couples.
void PrintCell (const int c)
 Print the particles in a cell.
void PrintCells ()
 Print the the particles in the cells.
void SetCurr (int p)
 Gather information of the neighbouring cells.
void SetCurrGhost (double *Pos)
 Gather information of the neighbouring cells.
void NextCurr ()
 Increase the iterator to the next couple.
void NextCurrGhost ()
 Increase the iterator to the next couple.
int IfCurr ()
 Tell when the curr loop is over.
int IfCurrGhost ()
 Tell when the curr loop is over.
void Dist2Curr (double *DistRel)
 Retrun the squared current interparticle distance.
void Dist2CurrGhost (double *DistRel)
 Retrun the squared current interparticle distance.
void PrintList (const int c)
 Print the the particle list in the cells.
void PrintLists ()
 Print the the particle list in the cells.
void CheckList ()
 Check the list.
void CheckNei (int p)
 Check the neighbours.
void IncrCurr (const int c)
 Increment the current part in the cell.
void IncrCurrList (const int c)
 Increment the current iterators in the cell.
int FindClosest (int p1)
 Find the closest neighbour.

Public Attributes

DomCellCella
 Number of particles and iterators per cell.
DOMAIN_PARTPc
 List of position of the particles.

Detailed Description

Domain decomposition as pointer to linked particles.

Definition at line 162 of file Cubo.h.


Constructor & Destructor Documentation

DdLinkedList ( double  Edge[3],
int  NPart,
double  CutOff 
)

Member Function Documentation

void Erase ( )

Erase the pairlist.

Empty the records of the cells.

Definition at line 258 of file Cubo.cpp.

References DOMAIN_PART::Cell, Cella, DomCell::Last, DomDecBasics::NCell, DOMAIN_PART::Next, DomDecBasics::NPart, DomCell::NPart, Pc, and DOMAIN_PART::Prev.

Referenced by Forces::Dynamics(), Forces::MinimalNrg(), and Forces::ReOpen().

void AddPart ( const int  p,
double *  Pos 
)
void RemPart ( const int  p,
double *  Pos 
)

Remove a particle form the cell c.

Remove particle from the cell.

Definition at line 307 of file Cubo.cpp.

References DomDecBasics::pCella().

Referenced by Forces::IgnoreCh(), MovePart(), Forces::RemChFromSys(), Forces::RemoveChBias(), RemPart(), Forces::TryInsert(), Forces::TryRemove(), and Forces::WidomInsert().

void RemPart ( const int  p)

Remove the particle p.

Remove a part to the correspondent cell.

Definition at line 336 of file Cubo.cpp.

References DOMAIN_PART::Cell, Pc, RemPart(), and DomDecBasics::SigErr().

void AddPart ( const int  p,
const int  c 
)

Add a particle to the cell c.

Add a part to the correspondent cell.

Definition at line 285 of file Cubo.cpp.

References DOMAIN_PART::Cell, Cella, DomCell::First, DomCell::Last, DomDecBasics::NAllocP, DOMAIN_PART::Next, DomDecBasics::NPart, DomCell::NPart, Pc, DOMAIN_PART::Prev, and DomDecBasics::SigErr().

void RemPart ( const int  p,
const int  c 
)

Remove a particle form the cell c.

Remove a part to the correspondent cell.

Definition at line 312 of file Cubo.cpp.

References DOMAIN_PART::Cell, Cella, DomCell::First, DomCell::Last, DomDecBasics::NAllocP, DOMAIN_PART::Next, DomDecBasics::NPart, DomCell::NPart, Pc, DOMAIN_PART::Prev, and DomDecBasics::SigErr().

void MovePart ( const int  p,
double *  OldPos,
double *  NewPos 
)

Move a particle form the cell c1 to the cell c2.

Shift a particle from one position to its new.

Definition at line 403 of file Cubo.cpp.

References AddPart(), Pc, DomDecBasics::pCella(), RemPart(), and SetCoorNumb().

Referenced by Forces::TryMove().

void MovePart ( const int  p,
double *  NewPos 
)

Move a particle form the cell c1 to the cell c2.

Shift a particle from one position to its new.

Definition at line 393 of file Cubo.cpp.

References AddPart(), Pc, pCell(), DomDecBasics::pCella(), RemPart(), and SetCoorNumb().

int IfItCell ( const int  c)

Stop the loop and set the counter to zero.

Return 0 when the loop inside the cell is over.

Definition at line 427 of file Cubo.cpp.

References Cella, DomCell::Curr1, DomCell::First, and DomDecBasics::NPart.

Referenced by VarData::FindNeighbours(), and PrintCell().

int IfItCouple ( const int  c)

Stop the loop and set the counter to zero.

Return zero when both iterators are over the loop.

Definition at line 572 of file Cubo.cpp.

References Cella, DomCell::Curr1, DomCell::Curr2, DomCell::First, DOMAIN_PART::Next, DomDecBasics::NPart, and Pc.

int SetCoorNumb ( double *  Pos,
int  p 
)

Set the coordination umber to the part p.

Coordination number of the particle in the cell.

Definition at line 271 of file Cubo.cpp.

References DOMAIN_PART::Coord, DomDecBasics::GetCoorNumb(), and Pc.

Referenced by AddPart(), and MovePart().

void SetCounters ( int  c)

Set the counters to the initial position.

Set the counters to the first particle of the cell c1 for the first loop.

Definition at line 413 of file Cubo.cpp.

References Cella, DomCell::Curr1, DomCell::Curr2, DomCell::First, DomDecBasics::NCell, DOMAIN_PART::Next, DomDecBasics::NPart, and Pc.

Referenced by VarData::FindNeighbours(), and PrintCell().

void Couple ( const int  c,
int *  p1,
int *  p2 
)

Iterates along all couples.

Associate the two iterator of the cell to the particles p1 and p2.

Definition at line 565 of file Cubo.cpp.

References Cella, DomCell::Curr1, DomCell::Curr2, DomDecBasics::NAllocP, and DomDecBasics::SigErr().

void PrintCell ( const int  c)

Print the particles in a cell.

Print the content of the cell.

Reimplemented from DomDecBasics.

Definition at line 439 of file Cubo.cpp.

References Cella, IfItCell(), IncrCurr(), ItCell(), Next(), DomDecBasics::NPart, Pc, and SetCounters().

Referenced by PrintCells().

void PrintCells ( )

Print the the particles in the cells.

Print the content of all cells.

Reimplemented from DomDecBasics.

Definition at line 446 of file Cubo.cpp.

References DomDecBasics::NCell, and PrintCell().

void SetCurr ( int  p)
int IfCurr ( )
void Dist2Curr ( double *  DistRel)
void Dist2CurrGhost ( double *  DistRel)

Retrun the squared current interparticle distance.

Iterate one step and return the position.

Definition at line 554 of file Cubo.cpp.

References DomDecBasics::Edge, DomDecBasics::InvEdge, DomDecBasics::p2Curr, Pc, DOMAIN_PART::Pos, and DomDecBasics::PosCurr.

Referenced by Forces::DensFuncNrgGhost().

void IncrCurr ( const int  c)

Increment the current part in the cell.

Increment the iterator to the next particle.

Definition at line 435 of file Cubo.cpp.

References Cella, DomCell::Curr1, DOMAIN_PART::Next, and Pc.

Referenced by VarData::FindNeighbours(), and PrintCell().

void IncrCurrList ( const int  c)

Increment the current iterators in the cell.

Increment the second iterator and the first when the second is over the loop.

Definition at line 582 of file Cubo.cpp.

References Cella, DomCell::Curr1, DomCell::Curr2, DomDecBasics::NAllocP, DOMAIN_PART::Next, Next(), Pc, and DomDecBasics::SigErr().


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