org.miv.pherd.ntree
Class BarycenterCellData

java.lang.Object
  extended by org.miv.pherd.ntree.BarycenterCellData
All Implemented Interfaces:
CellData

public class BarycenterCellData
extends Object
implements CellData

Cell data that represent the barycenter of a cell.

For leaf cells the barycenter is computed from the particles in the cell. For non-lead cell, the barycenter represents the barycenters of each subcell.

Since:
2007
Author:
Antoine Dutot

Field Summary
 Cell cell
          The cell this data is attached to.
 Point3 center
          The barycenter.
 Object marked
          Allows debugging.
 double weight
          The importance of this centre (in other words, the number of particles represented by this barycenter).
 
Constructor Summary
BarycenterCellData()
           
 
Method Summary
 double distanceFrom(Point3 p)
          Distance between this barycentre and a point p.
 Point3 getCenter()
          The barycenter.
 double getWeight()
          The importance of the barycenter.
 CellData newCellData()
          Factory method to create new cell data when a cell is subdivided.
 void recompute()
          Recompute the data, since the cell contents changed.
 void setCell(Cell cell)
          Set the parent cell of this data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

center

public Point3 center
The barycenter.


weight

public double weight
The importance of this centre (in other words, the number of particles represented by this barycenter).


cell

public Cell cell
The cell this data is attached to.


marked

public Object marked
Allows debugging.

Constructor Detail

BarycenterCellData

public BarycenterCellData()
Method Detail

getCenter

public Point3 getCenter()
The barycenter.

Returns:
a point.

getWeight

public double getWeight()
The importance of the barycenter. This is the number of particles this barycenter represents.

Returns:
The weight.

distanceFrom

public double distanceFrom(Point3 p)
Distance between this barycentre and a point p.

Parameters:
p - The point to consider (the other is the barycentre).
Returns:
The distance between the point and this barycentre.

newCellData

public CellData newCellData()
Description copied from interface: CellData
Factory method to create new cell data when a cell is subdivided.

Specified by:
newCellData in interface CellData
Returns:
A new cell data element.

setCell

public void setCell(Cell cell)
Description copied from interface: CellData
Set the parent cell of this data. This occurs only once, as soon as the cell knows its data.

Specified by:
setCell in interface CellData
Parameters:
cell - The tied cell.

recompute

public void recompute()
Description copied from interface: CellData
Recompute the data, since the cell contents changed.

Specified by:
recompute in interface CellData


Copyright © 2011. All Rights Reserved.