Commit c8823edd authored by COULAUD Olivier's avatar COULAUD Olivier
Browse files

Try to Resolve conflict

parents 397bbfa5 b9892361
......@@ -12,7 +12,7 @@
#define FOCTREEARRANGER_HPP
#include "../Utils/FGlobal.hpp"
#include "../Utils/F3DPosition.hpp"
#include "../Utils/FPoint.hpp"
#include "../Containers/FVector.hpp"
#include "../Utils/FAssertable.hpp"
......@@ -37,8 +37,8 @@ public:
// For periodic
const FReal boxWidth = tree->getBoxWidth();
const F3DPosition min(tree->getBoxCenter(),-boxWidth/2);
const F3DPosition max(tree->getBoxCenter(),boxWidth/2);
const FPoint min(tree->getBoxCenter(),-boxWidth/2);
const FPoint max(tree->getBoxCenter(),boxWidth/2);
{ // iterate on the leafs and found particle to remove
typename OctreeClass::Iterator octreeIterator(tree);
......@@ -49,7 +49,7 @@ public:
typename ContainerClass::BasicIterator iter(*octreeIterator.getCurrentListTargets());
while( iter.hasNotFinished() ){
if(isPeriodic){
F3DPosition partPos = iter.data().getPosition();
FPoint partPos = iter.data().getPosition();
while(partPos.getX() < min.getX()){
partPos.incX(boxWidth);
}
......
......@@ -89,8 +89,8 @@ public:
{ // iterate on the leafs and found particle to remove or to send
// For periodic
const FReal boxWidth = tree->getBoxWidth();
const F3DPosition min(tree->getBoxCenter(),-boxWidth/2);
const F3DPosition max(tree->getBoxCenter(),boxWidth/2);
const FPoint min(tree->getBoxCenter(),-boxWidth/2);
const FPoint max(tree->getBoxCenter(),boxWidth/2);
typename OctreeClass::Iterator octreeIterator(tree);
octreeIterator.gotoBottomLeft();
......@@ -100,7 +100,7 @@ public:
typename ContainerClass::BasicIterator iter(*octreeIterator.getCurrentListTargets());
while( iter.hasNotFinished() ){
if(isPeriodic){
F3DPosition partPos = iter.data().getPosition();
FPoint partPos = iter.data().getPosition();
while(partPos.getX() < min.getX()){
partPos.incX(boxWidth);
}
......
......@@ -53,7 +53,7 @@ public:
* Must be implemented by each user Cell class
* @param inPosition the position of the current cell
*/
virtual void setPosition(const F3DPosition& inPosition) = 0;
virtual void setPosition(const FPoint& inPosition) = 0;
/**
* Must be implemented by each user Cell class
......
......@@ -13,7 +13,7 @@
/* forward declaration to avoid include */
class F3DPosition;
class FPoint;
/**
* @author Berenger Bramas (berenger.bramas@inria.fr)
......@@ -42,7 +42,7 @@ public:
* Must be implemented by each user Particle class
* @return the position of the current cell
*/
virtual const F3DPosition& getPosition() const = 0;
virtual const FPoint& getPosition() const = 0;
};
......
......@@ -17,7 +17,7 @@
#include "../Utils/FDebug.hpp"
#include "../Utils/FGlobal.hpp"
#include "../Utils/F3DPosition.hpp"
#include "../Utils/FPoint.hpp"
#include "../Utils/FMath.hpp"
#include "../Utils/FNoCopyable.hpp"
#include "../Utils/FAssertable.hpp"
......@@ -33,7 +33,7 @@
* Please refere to testOctree.cpp to see an example.
* <code>
* // can be used as : <br>
* FOctree<TestParticle, TestCell> tree(1.0,F3DPosition(0.5,0.5,0.5));
* FOctree<TestParticle, TestCell> tree(1.0,FPoint(0.5,0.5,0.5));
* </code>
*
* Particles and cells has to respect the Abstract class definition.
......@@ -50,8 +50,8 @@ class FOctree : protected FAssertable, public FNoCopyable {
FAbstractSubOctree< ParticleClass, CellClass , ContainerClass, LeafClass>* root; //< root suboctree
const F3DPosition boxCenter; //< the space system center
const F3DPosition boxCorner; //< the space system corner (used to compute morton index)
const FPoint boxCenter; //< the space system center
const FPoint boxCorner; //< the space system corner (used to compute morton index)
const FReal boxWidth; //< the space system width
......@@ -61,7 +61,7 @@ class FOctree : protected FAssertable, public FNoCopyable {
* @param inPosition position to compute
* @return the morton index
*/
FTreeCoordinate getCoordinateFromPosition(const F3DPosition& inPosition) const {
FTreeCoordinate getCoordinateFromPosition(const FPoint& inPosition) const {
// box coordinate to host the particle
FTreeCoordinate host;
// position has to be relative to corner not center
......@@ -94,7 +94,7 @@ public:
* @param inBoxCenter box center for this simulation
*/
FOctree(const int inHeight, const int inSubHeight,
const FReal inBoxWidth, const F3DPosition& inBoxCenter)
const FReal inBoxWidth, const FPoint& inBoxCenter)
: boxWidthAtLevel(new FReal[inHeight]),
height(inHeight) , subHeight(inSubHeight), leafIndex(this->height-1),
root(0), boxCenter(inBoxCenter), boxCorner(inBoxCenter,-(inBoxWidth/2)), boxWidth(inBoxWidth)
......@@ -138,7 +138,7 @@ public:
}
/** To get the center of the box */
const F3DPosition& getBoxCenter() const{
const FPoint& getBoxCenter() const{
return this->boxCenter;
}
......@@ -189,7 +189,7 @@ public:
* @param a position to compute MI
* @return the morton index
*/
MortonIndex getMortonFromPosition(const F3DPosition& position) const {
MortonIndex getMortonFromPosition(const FPoint& position) const {
return getCoordinateFromPosition(position).getMortonIndex(leafIndex);
}
......
......@@ -13,7 +13,7 @@
#include "../Utils/FGlobal.hpp"
#include "../Utils/F3DPosition.hpp"
#include "../Utils/FPoint.hpp"
#include "../Utils/FAssertable.hpp"
#include "../Utils/FMath.hpp"
......
......@@ -28,13 +28,12 @@
*/
class FTreeCoordinate{
private:
int x; //< x box-th position
int y; //< y box-th position
int z; //< z box-th position
int data[3]; //< all box-th position
public:
/** Default constructor (position = {0,0,0})*/
FTreeCoordinate() : x(0), y(0), z(0){
FTreeCoordinate() {
data[0] = data[1] = data[2] = 0;
}
/**
......@@ -43,23 +42,30 @@ public:
* @param inY the y
* @param inZ the z
*/
explicit FTreeCoordinate(const int inX,const int inY,const int inZ)
: x(inX), y(inY), z(inZ){
explicit FTreeCoordinate(const int inX,const int inY,const int inZ) {
data[0] = inX;
data[1] = inY;
data[2] = inZ;
}
/**
* Copy constructor
* @param other the source class to copy
*/
FTreeCoordinate(const FTreeCoordinate& other):x(other.x), y(other.y), z(other.z){
FTreeCoordinate(const FTreeCoordinate& other) {
data[0] = other.data[0];
data[1] = other.data[1];
data[2] = other.data[2];
}
/**
* Copy constructor
* @param other the source class to copy
*/
FTreeCoordinate(const FTreeCoordinate& other, const int inOffset)
: x(other.x + inOffset), y(other.y + inOffset), z(other.z + inOffset){
FTreeCoordinate(const FTreeCoordinate& other, const int inOffset) {
data[0] = other.data[0] + inOffset;
data[1] = other.data[1] + inOffset;
data[2] = other.data[2] + inOffset;
}
/**
......@@ -68,9 +74,9 @@ public:
* @return this a reference to the current object
*/
FTreeCoordinate& operator=(const FTreeCoordinate& other){
this->x = other.x;
this->y = other.y;
this->z = other.z;
data[0] = other.data[0];
data[1] = other.data[1];
data[2] = other.data[2];
return *this;
}
......@@ -81,33 +87,33 @@ public:
* @param inZ the new z
*/
void setPosition(const int inX,const int inY,const int inZ){
this->x = inX;
this->y = inY;
this->z = inZ;
data[0] = inX;
data[1] = inY;
data[2] = inZ;
}
/**
* X Getter
* @return this->x
* @return data[0]
*/
int getX() const{
return this->x;
return data[0];
}
/**
* Y Getter
* @return this->y
* @return data[1]
*/
int getY() const{
return this->y;
return data[1];
}
/**
* Z Getter
* @return this->z
* @return data[2]
*/
int getZ() const{
return this->z;
return data[2];
}
/**
......@@ -115,7 +121,7 @@ public:
* @param the new x
*/
void setX(const int inX){
this->x = inX;
data[0] = inX;
}
/**
......@@ -123,7 +129,7 @@ public:
* @param the new y
*/
void setY(const int inY){
this->y = inY;
data[1] = inY;
}
/**
......@@ -131,7 +137,7 @@ public:
* @param the new z
*/
void setZ(const int inZ){
this->z = inZ;
data[2] = inZ;
}
/**
......@@ -144,9 +150,9 @@ public:
MortonIndex index = 0x0LL;
MortonIndex mask = 0x1LL;
// the ordre is xyz.xyz...
MortonIndex mx = this->x << 2;
MortonIndex my = this->y << 1;
MortonIndex mz = this->z;
MortonIndex mx = data[0] << 2;
MortonIndex my = data[1] << 1;
MortonIndex mz = data[2];
for(int indexLevel = 0; indexLevel < inLevel ; ++indexLevel){
index |= (mz & mask);
......@@ -171,16 +177,16 @@ public:
void setPositionFromMorton(MortonIndex inIndex, const int inLevel){
MortonIndex mask = 0x1LL;
this->x = 0;
this->y = 0;
this->z = 0;
data[0] = 0;
data[1] = 0;
data[2] = 0;
for(int indexLevel = 0; indexLevel < inLevel ; ++indexLevel){
z |= int(inIndex & mask);
data[2] |= int(inIndex & mask);
inIndex >>= 1;
y |= int(inIndex & mask);
data[1] |= int(inIndex & mask);
inIndex >>= 1;
x |= int(inIndex & mask);
data[0] |= int(inIndex & mask);
mask <<= 1;
}
......@@ -192,14 +198,14 @@ public:
* @return true if other & current object have same position
*/
bool operator==(const FTreeCoordinate& other) const {
return x == other.x && y == other.y && z == other.z;
return data[0] == other.data[0] && data[1] == other.data[1] && data[2] == other.data[2];
}
/** To test difference
*
*/
bool operator!=(const FTreeCoordinate& other) const{
return x != other.x || y != other.y || z != other.z;
return data[0] != other.data[0] || data[1] != other.data[1] || data[2] != other.data[2];
}
/**
......@@ -214,14 +220,13 @@ public:
return output; // for multiple << operators.
}
/** Save current object */
void save(FBufferWriter& buffer) const {
buffer << x << y << z;
buffer << data[0] << data[1] << data[2];
}
/** Retrieve current object */
void restore(FBufferReader& buffer) {
buffer >> x >> y >> z;
buffer >> data[0] >> data[1] >> data[2];
}
};
......
This diff is collapsed.
......@@ -13,7 +13,7 @@
#include "../Utils/FGlobal.hpp"
#include "../Utils/F3DPosition.hpp"
#include "../Utils/FPoint.hpp"
#include "../Containers/FBufferReader.hpp"
#include "../Containers/FBufferWriter.hpp"
......@@ -27,7 +27,7 @@
*/
class FExtendForces {
protected:
F3DPosition forces; //< 3D vector stored in a position object
FPoint forces; //< 3D vector stored in a position object
public:
/** Default constructor */
......@@ -45,12 +45,12 @@ public:
}
/** Return the forces */
const F3DPosition& getForces() const {
const FPoint& getForces() const {
return this->forces;
}
/** Set Forces */
void incForces(const F3DPosition& inForces) {
void incForces(const FPoint& inForces) {
this->forces += inForces;
}
......
......@@ -13,7 +13,7 @@
#include "../Utils/FGlobal.hpp"
#include "../Utils/F3DPosition.hpp"
#include "../Utils/FPoint.hpp"
#include "../Containers/FBufferReader.hpp"
#include "../Containers/FBufferWriter.hpp"
......@@ -26,7 +26,7 @@
*/
class FExtendPosition {
protected:
F3DPosition position; //< The position
FPoint position; //< The position
public:
/** Default constructor */
......@@ -44,12 +44,12 @@ public:
}
/** To get the position */
const F3DPosition& getPosition() const {
const FPoint& getPosition() const {
return this->position;
}
/** To set the position */
void setPosition(const F3DPosition& inPosition) {
void setPosition(const FPoint& inPosition) {
this->position = inPosition;
}
......@@ -61,7 +61,7 @@ public:
}
/** Set Position */
void incPosition(const F3DPosition& inPosition) {
void incPosition(const FPoint& inPosition) {
this->position += inPosition;
}
......
......@@ -14,7 +14,7 @@
#include "../Utils/FGlobal.hpp"
#include "../Utils/F3DPosition.hpp"
#include "../Utils/FPoint.hpp"
#include "../Containers/FBufferReader.hpp"
#include "../Containers/FBufferWriter.hpp"
......@@ -28,7 +28,7 @@
*/
class FExtendVelocity {
protected:
F3DPosition velocity; //< 3D vector stored in a position object
FPoint velocity; //< 3D vector stored in a position object
public:
/** Default constructor */
......@@ -46,12 +46,12 @@ public:
}
/** Return the velocity */
const F3DPosition& getVelocity() const {
const FPoint& getVelocity() const {
return this->velocity;
}
/** Set Velocity */
void incVelocity(const F3DPosition& inVelocity) {
void incVelocity(const FPoint& inVelocity) {
this->velocity += inVelocity;
}
......
......@@ -13,7 +13,7 @@
#include "../Utils/FGlobal.hpp"
class F3DPosition;
class FPoint;
/**
* @author Berenger Bramas (berenger.bramas@inria.fr)
......@@ -46,7 +46,7 @@ public:
* Get the center of the simulation box
* @return box center needed by the octree
*/
virtual F3DPosition getCenterOfBox() const = 0;
virtual FPoint getCenterOfBox() const = 0;
/**
* Get the simulation box width
......
......@@ -17,7 +17,7 @@
#include "../Utils/FGlobal.hpp"
#include "FAbstractLoader.hpp"
#include "../Utils/F3DPosition.hpp"
#include "../Utils/FPoint.hpp"
/**
* @author Berenger Bramas (berenger.bramas@inria.fr)
......@@ -48,7 +48,7 @@ template <class ParticleClass>
class FBasicLoader : public FAbstractLoader<ParticleClass> {
protected:
std::ifstream file; //< The file to read
F3DPosition centerOfBox; //< The center of box read from file
FPoint centerOfBox; //< The center of box read from file
FReal boxWidth; //< the box width read from file
int nbParticles; //< the number of particles read from file
......@@ -98,7 +98,7 @@ public:
* The center of the box from the simulation file opened by the loader
* @return box center
*/
F3DPosition getCenterOfBox() const{
FPoint getCenterOfBox() const{
return this->centerOfBox;
}
......@@ -118,7 +118,7 @@ public:
void fillParticle(ParticleClass& inParticle){
FReal x,y,z;
this->file >> x >> y >> z;
inParticle.setPosition(F3DPosition(x,y,z));
inParticle.setPosition(FPoint(x,y,z));
}
};
......
......@@ -18,7 +18,7 @@
#include "../Utils/FGlobal.hpp"
#include "FAbstractLoader.hpp"
#include "../Utils/F3DPosition.hpp"
#include "../Utils/FPoint.hpp"
/**
* @author Berenger Bramas (berenger.bramas@inria.fr)
......@@ -30,7 +30,7 @@ template <class ParticleClass>
class FEwalLoader : public FAbstractLoader<ParticleClass> {
protected:
std::ifstream file; //< The file to read
F3DPosition centerOfBox; //< The center of box read from file
FPoint centerOfBox; //< The center of box read from file
FReal boxWidth; //< the box width read from file
int nbParticles; //< the number of particles read from file
......@@ -97,7 +97,7 @@ public:
* The center of the box from the simulation file opened by the loader
* @return box center
*/
F3DPosition getCenterOfBox() const{
FPoint getCenterOfBox() const{
return this->centerOfBox;
}
......
......@@ -16,7 +16,7 @@
#include "../Utils/FGlobal.hpp"
#include "FAbstractLoader.hpp"
#include "../Utils/F3DPosition.hpp"
#include "../Utils/FPoint.hpp"
#include "../Utils/FDebug.hpp"
/**
......@@ -50,7 +50,7 @@ template <class ParticleClass>
class FFmaBinLoader : public FAbstractLoader<ParticleClass> {
protected:
FILE* const file; //< The file to read
F3DPosition centerOfBox; //< The center of box read from file
FPoint centerOfBox; //< The center of box read from file
FReal boxWidth; //< the box width read from file
FSize nbParticles; //< the number of particles read from file
......@@ -115,7 +115,7 @@ public:
* The center of the box from the simulation file opened by the loader
* @return box center
*/
F3DPosition getCenterOfBox() const{
FPoint getCenterOfBox() const{
return this->centerOfBox;
}
......
......@@ -17,7 +17,7 @@
#include "../Utils/FGlobal.hpp"
#include "FAbstractLoader.hpp"
#include "../Utils/F3DPosition.hpp"
#include "../Utils/FPoint.hpp"
/**
* @author Berenger Bramas (berenger.bramas@inria.fr)
......@@ -50,7 +50,7 @@ template <class ParticleClass>
class FFmaLoader : public FAbstractLoader<ParticleClass> {
protected:
std::ifstream file; //< The file to read
F3DPosition centerOfBox; //< The center of box read from file
FPoint centerOfBox; //< The center of box read from file
FReal boxWidth; //< the box width read from file
int nbParticles; //< the number of particles read from file
......@@ -101,7 +101,7 @@ public:
* The center of the box from the simulation file opened by the loader
* @return box center
*/
F3DPosition getCenterOfBox() const{
FPoint getCenterOfBox() const{
return this->centerOfBox;
}
......
<
......@@ -17,7 +17,7 @@
#include "../Utils/FGlobal.hpp"
#include "FAbstractLoader.hpp"
#include "../Utils/F3DPosition.hpp"
#include "../Utils/FPoint.hpp"
/**
* @author Berenger Bramas (berenger.bramas@inria.fr)
......@@ -50,7 +50,7 @@ template <class ParticleClass>
class FFmaScanfLoader : public FAbstractLoader<ParticleClass> {
protected:
FILE* file; //< The file to read
F3DPosition centerOfBox; //< The center of box read from file
FPoint centerOfBox; //< The center of box read from file
FReal boxWidth; //< the box width read from file
int nbParticles; //< the number of particles read from file
......@@ -108,7 +108,7 @@ public:
* The center of the box from the simulation file opened by the loader
* @return box center
*/
F3DPosition getCenterOfBox() const{
FPoint getCenterOfBox() const{
return this->centerOfBox;
}
......